File size: 315 Bytes
63f6011
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import FastAPI
from routers import user, team
from db import engine

app = FastAPI()

app.include_router(user.router)
app.include_router(team.router)

@app.on_event("startup")
async def startup():
    await engine.connect()

@app.on_event("shutdown")
async def shutdown():
    await engine.disconnect()