25 lines
545 B
Python
25 lines
545 B
Python
|
|
from fastapi import FastAPI
|
||
|
|
from fastapi.middleware.cors import CORSMiddleware
|
||
|
|
|
||
|
|
from api.routers.health import router as health_router
|
||
|
|
|
||
|
|
|
||
|
|
app = FastAPI(title="Common FastAPI App")
|
||
|
|
app.include_router(health_router)
|
||
|
|
|
||
|
|
# Keep permissive defaults; tighten for production deployments.
|
||
|
|
app.add_middleware(
|
||
|
|
CORSMiddleware,
|
||
|
|
allow_origins=["*"],
|
||
|
|
allow_credentials=True,
|
||
|
|
allow_methods=["*"],
|
||
|
|
allow_headers=["*"],
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
import uvicorn
|
||
|
|
|
||
|
|
uvicorn.run("api.main:app", host="0.0.0.0", port=8000, reload=True)
|
||
|
|
|