Fixed formatting and type definitions

This commit is contained in:
Hannah dagemark 2026-08-06 21:32:43 +02:00
commit d97335e0c7
5 changed files with 112 additions and 65 deletions

View file

@ -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)