20 lines
No EOL
485 B
Python
20 lines
No EOL
485 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from .readings import readings_router
|
|
from .devices import devices_router
|
|
|
|
app = FastAPI(title="SimuGazAPI", version="1.0.0")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["https://demo.agreg.ungol.fr"],
|
|
allow_methods=["GET"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(readings_router)
|
|
app.include_router(devices_router)
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"status": "ok"} |