This example shows how to deploy a minimal Flask application to Wasmer Edge.
https://wasmer-python-flask-server-worker.wasmer.app/
src/main.py defines the application:
app = Flask(__name__)creates the WSGI app Wasmer will import (src.main:app).@app.route("/")responds with a simple string (“Hello, from Flask in Wasmer Edge 🚀”).- The
__main__block runs the built-in server on host0.0.0.0and port8000for local testing.
Because the project has no external dependencies beyond Flask itself, it is ideal for learning the deployment flow.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python src/main.pyVisit http://127.0.0.1:8000/ to view the greeting.
- Install dependencies during your build (
pip install -r requirements.txt). - Expose the app as
src.main:appin your Wasmer configuration (e.g., viawasmer.toml) and rungunicornor the Flask dev server (python -m flask --app src.main run --host 0.0.0.0 --port $PORT). - Deploy and access
https://<your-subdomain>.wasmer.app/.