feat: new run method & add local dev setup

This commit is contained in:
swve 2024-03-31 15:14:25 +02:00
parent 67c18a2d1e
commit 24be39f7e3
6 changed files with 27 additions and 6 deletions

View file

@ -1,3 +1,4 @@
import uvicorn
from fastapi import FastAPI, Request
from config.config import LearnHouseConfig, get_learnhouse_config
from src.core.events.events import shutdown_app, startup_app
@ -60,6 +61,15 @@ app.mount("/content", StaticFiles(directory="content"), name="content")
app.include_router(v1_router)
if __name__ == "__main__":
uvicorn.run(
"app:app",
host="0.0.0.0",
port=learnhouse_config.hosting_config.port,
reload=learnhouse_config.general_config.development_mode,
)
# General Routes
@app.get("/")
async def root():