From f9547c289e148f403aa25a92102402ca3fc155d1 Mon Sep 17 00:00:00 2001 From: W1CDN Date: Sat, 8 Apr 2023 20:05:35 -0500 Subject: [PATCH] Add Waitress but needs work. --- start_api_waitress.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 start_api_waitress.py diff --git a/start_api_waitress.py b/start_api_waitress.py new file mode 100644 index 0000000..2922193 --- /dev/null +++ b/start_api_waitress.py @@ -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=5000)