feat: 第一次上传
This commit is contained in:
18
app.py
Normal file
18
app.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user