30 lines
799 B
Python
30 lines
799 B
Python
"""Точка входа FastAPI-приложения АС «Платформа ОПОРА РОССИИ»."""
|
|
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="АС «Платформа ОПОРА РОССИИ»",
|
|
version="0.1.0",
|
|
docs_url="/api/docs",
|
|
openapi_url="/api/openapi.json",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.cors_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(api_router, prefix="/api/v1")
|
|
|
|
|
|
@app.get("/health", tags=["system"])
|
|
def health() -> dict:
|
|
"""Проверка работоспособности."""
|
|
return {"status": "ok"}
|