| 12345678910111213141516171819202122232425262728293031 |
- from fastapi import FastAPI
- from fastapi.middleware.cors import CORSMiddleware
- from .config import get_settings
- from .routers import apps_router, categories_router
- settings = get_settings()
- app = FastAPI(
- title=settings.app_name,
- version="1.0.0",
- docs_url="/docs",
- redoc_url="/redoc",
- openapi_url="/openapi.json",
- )
- app.add_middleware(
- CORSMiddleware,
- allow_origins=["*"],
- allow_credentials=True,
- allow_methods=["GET"],
- allow_headers=["*"],
- )
- app.include_router(categories_router)
- app.include_router(apps_router)
- @app.get("/health", tags=["Health"])
- async def health_check():
- return {"status": "ok"}
|