forked from AnantaaKotal/AgentCyTE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (21 loc) · 810 Bytes
/
Copy pathmain.py
File metadata and controls
33 lines (21 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Convenience entry point for running the Flask Web UI."""
from __future__ import annotations
import os
from typing import Final
from webapp.app_backend import app
def _env_flag(value: str | None) -> bool:
if value is None:
return False
return value.strip().lower() in {"1", "true", "yes", "on"}
def main() -> None:
"""Start the Web UI using the in-repo Flask application."""
default_host: Final[str] = os.environ.get("CORETG_HOST", "0.0.0.0")
port_str = os.environ.get("CORETG_PORT", "9090")
debug = _env_flag(os.environ.get("CORETG_DEBUG"))
try:
port = int(port_str)
except ValueError:
raise SystemExit(f"Invalid CORETG_PORT value: {port_str!r}")
app.run(host=default_host, port=port, debug=debug)
if __name__ == "__main__":
main()