forked from Soju06/codex-lb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
25 lines (16 loc) · 618 Bytes
/
Copy pathrun.py
File metadata and controls
25 lines (16 loc) · 618 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
#!/usr/bin/env python3
"""Entrypoint: load config.toml and serve the middleware with uvicorn."""
from __future__ import annotations
import logging
from pathlib import Path
import uvicorn
from middleware.app import create_app
from middleware.config import load_config
ROOT = Path(__file__).resolve().parent
def main() -> None:
cfg = load_config(ROOT / "config.toml")
logging.basicConfig(level=getattr(logging, cfg.log.level.upper(), logging.INFO))
app = create_app(cfg)
uvicorn.run(app, host=cfg.server.host, port=cfg.server.port, log_level=cfg.log.level)
if __name__ == "__main__":
main()