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"})