Skip to content

Commit 5df0790

Browse files
committed
Implemented waitress to host production WSGI HTTP server #49
1 parent 934f00e commit 5df0790

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

imaginate_api/app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@ def handle_exception(exc: HTTPException):
3939

4040
# Run app on invocation
4141
if __name__ == "__main__":
42-
app.run()
42+
if Config.DB_ENV == 'prod':
43+
from waitress import serve
44+
serve(app, host="0.0.0.0", port=8080)
45+
else:
46+
app.run()

0 commit comments

Comments
 (0)