diff --git a/src/main.py b/src/main.py index 7314299..a507c7d 100644 --- a/src/main.py +++ b/src/main.py @@ -1,9 +1,13 @@ from fastapi import FastAPI from contextlib import asynccontextmanager +from dotenv import load_dotenv +from os import getenv from routes import routes from lib import logger +load_dotenv() + @asynccontextmanager async def lifespan(app: FastAPI): @@ -26,4 +30,9 @@ for route in routes: if __name__ == "__main__": import uvicorn - uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) + uvicorn.run( + "main:app", + host="0.0.0.0", + port=int(getenv("PORT", 80)), + reload=getenv("RELOAD", "false") == "true", + )