From dfad57ade41d9dabebea760dba2c8260028ef786 Mon Sep 17 00:00:00 2001 From: James Roberts Date: Thu, 21 Oct 2021 23:35:01 +0200 Subject: [PATCH] Add example --- README.md | 2 ++ testapp.py => example.py | 4 +--- run.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename testapp.py => example.py (58%) diff --git a/README.md b/README.md index fd53dd6..151dd89 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/testapp.py b/example.py similarity index 58% rename from testapp.py rename to example.py index 7d5b6c3..ca1a8d9 100644 --- a/testapp.py +++ b/example.py @@ -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) diff --git a/run.sh b/run.sh index 8885121..048946b 100644 --- a/run.sh +++ b/run.sh @@ -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;