From d1199ada02751365c26987428441a073dc8ea7ff Mon Sep 17 00:00:00 2001 From: openclaw Date: Sat, 11 Apr 2026 03:58:22 +0000 Subject: [PATCH] Add app/main.py --- app/main.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/main.py diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..37425b0 --- /dev/null +++ b/app/main.py @@ -0,0 +1,23 @@ +from fastapi import FastAPI +from fastapi.responses import JSONResponse + +from app.config import settings +from app.database import engine, Base +from app.routers import categories, products, stock + +Base.metadata.create_all(bind=engine) + +app = FastAPI( + title="API Inventario", + description="Microservicio para gestionar inventario", + version="1.0.0", +) + +app.include_router(categories.router, prefix=f"/api/{settings.API_VERSION}", tags=["Categories"]) +app.include_router(products.router, prefix=f"/api/{settings.API_VERSION}", tags=["Products"]) +app.include_router(stock.router, prefix=f"/api/{settings.API_VERSION}", tags=["Stock"]) + + +@app.get("/health") +def health(): + return JSONResponse({"status": "ok"})