Spaces:
Sleeping
Sleeping
# uvicorn app:app --host localhost --port 7860 --reload | |
from library.librerias import * | |
from routers.routers import * | |
app = FastAPI( | |
title="API de la heladería Anhelados", | |
description="Esta es la API de la microempresa Anhelados, la cual se dedica a la venta de helados y postres. Aquí se pueden realizar operaciones CRUD para los recursos de la empresa.", | |
version="2.8.7", | |
openapi_url="/anhelados-openapi.json", | |
docs_url="/anhelados-docs", | |
redoc_url="/anhelados-redoc", | |
contact={ | |
"name": "Anhelados", | |
"url": "https://www.anhelados.com", | |
"email": "contacto@anhelados.com", | |
}, | |
license_info={"name": "MIT", "url": "https://opensource.org/licenses/MIT"}, | |
) | |
# CORS | |
app.add_middleware( | |
CORSMiddleware, | |
allow_origins=["*"], | |
allow_credentials=True, | |
allow_methods=["*"], | |
allow_headers=["*"], | |
) | |
# saludo | |
def read_root(): | |
return {"message": "Bienvenido a la API de la heladeria"} | |
# Routers | |
app.router.include_router(almacen.router) | |
app.router.include_router(clientes.router) | |
app.router.include_router(detalle_pedidos.router) | |
app.router.include_router(detalle_ventas.router) | |
app.router.include_router(empleados.router) | |
app.router.include_router(gastos_imprevistos.router) | |
app.router.include_router(gastos.router) | |
app.router.include_router(insumos.router) | |
app.router.include_router(maquinas.router) | |
app.router.include_router(pedidos_proveedor.router) | |
app.router.include_router(produccion.router) | |
app.router.include_router(productos.router) | |
app.router.include_router(registro_energetico.router) | |
app.router.include_router(ventas.router) | |