https://github.com/wasmerio/python-flask-example
Sample Python Flask server for Wasmer Edge
https://github.com/wasmerio/python-flask-example
flask python python3 wasmer wasmer-edge webassembly
Last synced: 12 months ago
JSON representation
Sample Python Flask server for Wasmer Edge
- Host: GitHub
- URL: https://github.com/wasmerio/python-flask-example
- Owner: wasmerio
- Created: 2023-10-05T11:28:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-05T17:13:41.000Z (over 2 years ago)
- Last Synced: 2025-06-22T06:15:23.802Z (about 1 year ago)
- Topics: flask, python, python3, wasmer, wasmer-edge, webassembly
- Language: Python
- Homepage:
- Size: 103 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample Python Flask Server with Wasmer
This is a sample repo for running a Python's Flask server on Wasmer Edge.
## Running it locally
### Clone the repo
```shell
git clone https://github.com/wasmerio/python-flask-example.git
```
### Setup the Virtual Environment
```shell
python3 -m venv .env
source .env/bin/activate
pip3 install Flask
```
### Run it locally using the command below
```shell
$ wasmer run . --net
* Serving Flask app '/src/main'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
```
## Running it using wasmer registry
This package is published to wasmer registry as [`wasmer/python-flask-server`](https://wasmer.io/wasmer/python-flask-server)
You can try this locally.
```shell
$ wasmer run . --net
* Serving Flask app '/src/main'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:8080
Press CTRL+C to quit
```
This would start an http server on `http://127.0.0.1:8080`

## Live on Wasmer Edge
You can check the app in:
https://wasmer-python-flask-server-worker.wasmer.app