3d21110dd9
Set docs_url=/api/docs, redoc_url=/api/redoc, openapi_url=/api/openapi.json so Swagger UI is accessible through nginx at http://localhost/api/docs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
491 B
Python
27 lines
491 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.api import tests
|
|
|
|
app = FastAPI(
|
|
title="QA Test App API",
|
|
version="0.1.0",
|
|
docs_url="/api/docs",
|
|
redoc_url="/api/redoc",
|
|
openapi_url="/api/openapi.json",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(tests.router)
|
|
|
|
|
|
@app.get("/api/health")
|
|
async def health():
|
|
return {"status": "ok"}
|