mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-30 00:34:58 +00:00
28 lines
786 B
Python
28 lines
786 B
Python
"""Workflow plugin: start Flask server."""
|
|
|
|
|
|
def run(runtime, inputs):
|
|
"""
|
|
Start the Flask web server.
|
|
|
|
Inputs:
|
|
host: Host address (default: 0.0.0.0)
|
|
port: Port number (default: 8000)
|
|
debug: Enable debug mode (default: False)
|
|
|
|
Returns:
|
|
dict: Success indicator (note: this blocks until server stops)
|
|
"""
|
|
app = runtime.context.get("flask_app")
|
|
if not app:
|
|
return {"error": "Flask app not found in context. Run web.create_flask_app first."}
|
|
|
|
host = inputs.get("host", "0.0.0.0")
|
|
port = inputs.get("port", 8000)
|
|
debug = inputs.get("debug", False)
|
|
|
|
# This will block until the server is stopped
|
|
app.run(host=host, port=port, debug=debug)
|
|
|
|
return {"result": "Server stopped"}
|