agreg-server/server/backend/adapters/http/main.py

20 lines
485 B
Python
Raw Normal View History

2026-05-10 12:36:38 +02:00
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .readings import readings_router
from .devices import devices_router
2026-05-10 12:36:38 +02:00
app = FastAPI(title="SimuGazAPI", version="1.0.0")
app.add_middleware(
CORSMiddleware,
2026-05-30 19:45:14 +02:00
allow_origins=["https://demo.agreg.ungol.fr"],
2026-05-10 12:36:38 +02:00
allow_methods=["GET"],
allow_headers=["*"],
)
app.include_router(readings_router)
app.include_router(devices_router)
2026-05-10 12:36:38 +02:00
@app.get("/health")
def health():
return {"status": "ok"}