diff --git a/shell.nix b/shell.nix index f421e15..3d71bfe 100644 --- a/shell.nix +++ b/shell.nix @@ -7,6 +7,7 @@ pkgs.mkShell { beautifulsoup4 flask lxml + waitress ])) pkgs.claude-code ]; diff --git a/src/web.py b/src/web.py index cb19b5f..28d5d89 100644 --- a/src/web.py +++ b/src/web.py @@ -8,6 +8,7 @@ import os from flask import Flask, render_template, g DB_PATH = os.environ.get("DB_PATH", "/data/huizenbot.db") +APP_ENV = os.environ.get("APP_ENV", "dev") app = Flask(__name__) @@ -57,4 +58,8 @@ def index(): if __name__ == "__main__": - app.run(debug=True, host="0.0.0.0", port=5000) + if APP_ENV == "dev": + app.run(debug=True, host="0.0.0.0", port=5000) + else: + from waitress import serve + serve(app, host="0.0.0.0", port=5000)