22 lines
473 B
Python
22 lines
473 B
Python
from pathlib import Path
|
|
import os
|
|
import sys
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from src.api.server import serve_api
|
|
|
|
|
|
def main(env=None) -> int:
|
|
env = os.environ if env is None else env
|
|
host = env.get("AI_ICT_API_HOST", "0.0.0.0")
|
|
port = int(env.get("AI_ICT_API_PORT", "8000"))
|
|
serve_api(host=host, port=port)
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|