Add app/main.py
This commit is contained in:
23
app/main.py
Normal file
23
app/main.py
Normal file
@@ -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"})
|
||||||
Reference in New Issue
Block a user