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:
- Convert the Flask routes into Cloudflare Worker event listeners / fetch handlers compatible with Cloudflare's Python worker runtime.
- Update any environment variable handling to use Cloudflare Worker bindings (
env.API_KEY, etc.). - Provide the exact wrangler.toml configuration file and the updated worker script code.
- Give me the exact terminal commands to log in, test locally, and deploy via Wrangler.
Top comments (0)