36 lines
844 B
Python
36 lines
844 B
Python
"""FastAPI 骨架入口:无业务路由、无数据库依赖,仅健康检查与文档。"""
|
|
import logging
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.core.config import settings
|
|
|
|
logger = logging.getLogger("zkxw")
|
|
|
|
app = FastAPI(
|
|
title=settings.APP_NAME,
|
|
description="中科兴皖一体化门户后端骨架(业务代码已移除,可按需从版本库恢复)",
|
|
version="1.0.0",
|
|
docs_url="/docs",
|
|
redoc_url="/redoc",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.BACKEND_CORS_ORIGINS,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
@app.get("/")
|
|
def root():
|
|
return {"name": settings.APP_NAME, "version": "1.0.0", "docs": "/docs"}
|
|
|
|
|
|
@app.get("/health")
|
|
def health_check():
|
|
return {"status": "healthy"}
|