Dagemark-Backend/app/main.py
2026-08-09 15:18:43 +02:00

26 lines
573 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, service_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)
app.include_router(service_route.router)