fix: update Flask port configuration to support environment variable

- Modified the Flask application to allow the port to be set via the `FLASK_PORT` environment variable, defaulting to 8080 if not specified.
- Ensured existing application logic remains unchanged while enhancing configurability for deployment environments.
This commit is contained in:
yuanmengqi
2025-07-27 16:14:07 +00:00
parent 523d553e88
commit 5fa490adf4

View File

@@ -733,7 +733,7 @@ if __name__ == '__main__':
# Start web service
host = os.getenv("FLASK_HOST", "0.0.0.0")
port = 8080
port = os.getenv("FLASK_PORT", 8080)
debug = os.getenv("FLASK_DEBUG", "false").lower() == "true"
app.run(host=host, port=port, debug=debug, threaded=True)