DEV Community

NWFD
NWFD

Posted on

oops

Refactor my Flask backend (app.py) to run as a Python-based Cloudflare Worker using Wrangler so I can host it 24/7 on Cloudflare without needing my desktop running.

Requirements:

  1. Convert the Flask routes into Cloudflare Worker event listeners / fetch handlers compatible with Cloudflare's Python worker runtime.
  2. Update any environment variable handling to use Cloudflare Worker bindings (env.API_KEY, etc.).
  3. Provide the exact wrangler.toml configuration file and the updated worker script code.
  4. Give me the exact terminal commands to log in, test locally, and deploy via Wrangler.

Top comments (0)