29 lines
678 B
Python
29 lines
678 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.core.config import get_settings
|
|
from app.routers import auth, boxes, objects, photos, qrcodes
|
|
|
|
settings = get_settings()
|
|
|
|
app = FastAPI(title="Inventory API")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.allowed_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(auth.router)
|
|
app.include_router(objects.router)
|
|
app.include_router(boxes.router)
|
|
app.include_router(photos.router)
|
|
app.include_router(qrcodes.router)
|
|
|
|
|
|
@app.get("/api/v1/health")
|
|
async def health() -> dict[str, str]:
|
|
return {"status": "ok"}
|