Fixed formatting and type definitions
This commit is contained in:
parent
bbe0df9546
commit
d97335e0c7
5 changed files with 112 additions and 65 deletions
27
app/main.py
27
app/main.py
|
|
@ -1,22 +1,27 @@
|
|||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.config import settings
|
||||
from app.database import create_database
|
||||
from app.routers import example_route, project_route
|
||||
|
||||
app = FastAPI(
|
||||
title=settings.app_name,
|
||||
version=settings.app_version
|
||||
)
|
||||
|
||||
@app.on_event("startup")
|
||||
def startup():
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
create_database()
|
||||
# Stuff that runs once before the app starts :D
|
||||
yield
|
||||
# Stuff that runs when it shuts down :>
|
||||
|
||||
app.include_router(
|
||||
example_route.router
|
||||
|
||||
app = FastAPI(
|
||||
lifespan=lifespan,
|
||||
title=settings.app_name,
|
||||
version=settings.app_version,
|
||||
)
|
||||
|
||||
app.include_router(
|
||||
project_route.router
|
||||
)
|
||||
|
||||
app.include_router(example_route.router)
|
||||
|
||||
app.include_router(project_route.router)
|
||||
|
|
|
|||
Loading…
Reference in a new issue