Dagemark-Backend/app/main.py
2026-08-06 22:56:13 +02:00

25 lines
517 B
Python

from contextlib import asynccontextmanager
from fastapi import FastAPI
from app.config import settings
from app.database import create_database
from app.routers import project_route
@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 = FastAPI(
lifespan=lifespan,
title=settings.app_name,
version=settings.app_version,
)
app.include_router(project_route.router)