-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (28 loc) · 902 Bytes
/
main.py
File metadata and controls
34 lines (28 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from contextlib import asynccontextmanager
from typing import AsyncGenerator
from fastapi import FastAPI
from app.api.v1.auth.router import router as auth_router
from app.api.v1.cs_tasks.router import router as cs_tasks_router
from app.api.v1.data_clone.router import router as data_clone_router
from app.core.config import settings
from app.core.database import init_db
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
# Startup
await init_db()
yield
# Shutdown
# Add any cleanup code here
app = FastAPI(
title="CS Admin Tool",
description="A comprehensive CS administration tool",
version="1.0.0",
lifespan=lifespan,
)
# Include routers
app.include_router(auth_router)
app.include_router(cs_tasks_router)
app.include_router(data_clone_router)
@app.get("/health")
async def health_check():
return {"status": "healthy"}