Add example

This commit is contained in:
James Roberts
2021-10-21 23:35:01 +02:00
parent f2f64a8132
commit dfad57ade4
3 changed files with 4 additions and 4 deletions

View File

@@ -12,6 +12,8 @@ It is mostly written in C. It makes use of [libuv](https://github.com/libuv/libu
## Example usage with Flask
See [example.py](https://github.com/jamesroberts/fast-wsgi/blob/main/testapp.py) for more details.
```python
import fast_wsgi
from flask import Flask

View File

@@ -1,5 +1,4 @@
import fast_wsgi
import bjoern
from flask import Flask
app = Flask(__name__)
@@ -11,5 +10,4 @@ def hello_world():
if __name__ == "__main__":
# fast_wsgi.run(wsgi_app=app, host="0.0.0.0", port=5000)
bjoern.run(app, "0.0.0.0", 5000)
fast_wsgi.run(wsgi_app=app, host="0.0.0.0", port=5000)

2
run.sh
View File

@@ -1 +1 @@
sudo python3 setup.py install; python3 testapp.py; fuser -k 5000/tcp;
sudo python3 setup.py install; python3 example.py; fuser -k 5000/tcp;