angeetoile's picture
feat: initialize VerifPulse FastAPI backend
436808d
Raw
History Blame Contribute Delete
808 Bytes
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.v1.router import api_router
from app.core.config import settings
app = FastAPI(
title=settings.app_name,
version=settings.app_version,
debug=settings.debug,
docs_url="/docs",
redoc_url="/redoc",
openapi_url="/openapi.json",
)
app.add_middleware(
CORSMiddleware,
allow_origins=settings.allowed_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(
api_router,
prefix=settings.api_v1_prefix,
)
@app.get("/", tags=["Root"])
async def root() -> dict[str, str]:
return {
"name": settings.app_name,
"version": settings.app_version,
"status": "running",
"documentation": "/docs",
}