Set up to run waitress in screen if needed.

This commit is contained in:
2023-04-11 20:52:59 -05:00
parent f9547c289e
commit 23d52a80da
3 changed files with 7 additions and 3 deletions

12
api_waitress.py Normal file
View File

@ -0,0 +1,12 @@
# run.py from https://www.devdungeon.com/content/run-python-wsgi-web-app-waitress
import os
from waitress import serve
from api_app import api_app # Import your app
# Run from the same directory as this script
this_files_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(this_files_dir)
# `url_prefix` is optional, but useful if you are serving app on a sub-dir
# behind a reverse-proxy.
serve(api_app, host='127.0.0.1', port=5001)