19 lines
405 B
Python
19 lines
405 B
Python
from contextlib import asynccontextmanager
|
|
from fastapi import FastAPI
|
|
import uvicorn
|
|
from routers import auth, home
|
|
from db.init_db import init_db
|
|
|
|
app = FastAPI()
|
|
|
|
app.include_router(auth.router)
|
|
app.include_router(home.router)
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(app: FastAPI):
|
|
init_db()
|
|
yield
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run("app:app", host="0.0.0.0", port=8080, reload=True)
|