import os
import sys

import uvicorn

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.dirname(BASE_DIR)
for path in (PARENT_DIR, BASE_DIR):
    if path not in sys.path:
        sys.path.insert(0, path)


def main() -> None:
    host = os.getenv("HOST", "127.0.0.1")
    port = int(os.getenv("PORT", "8001"))
    uvicorn.run("api_server:app", host=host, port=port)


if __name__ == "__main__":
    main()
