Files
WhatsAppCentralizado/services/api-gateway/app/main.py
Claude AI b8d97e2557 feat(fase4): add FlowTemplate model and API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:10:54 +00:00

45 lines
1.0 KiB
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.core.config import get_settings
from app.core.database import engine, Base
from app.routers import auth, whatsapp, flows, queues, supervisor, flow_templates
settings = get_settings()
# Create tables
Base.metadata.create_all(bind=engine)
app = FastAPI(
title="WhatsApp Centralizado API",
description="API Gateway for WhatsApp Centralizado platform",
version="1.0.0",
)
# CORS
origins = settings.CORS_ORIGINS.split(",")
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Routers
app.include_router(auth.router)
app.include_router(whatsapp.router)
app.include_router(flows.router)
app.include_router(queues.router)
app.include_router(supervisor.router)
app.include_router(flow_templates.router)
@app.get("/health")
def health_check():
return {"status": "ok"}
@app.get("/api/health")
def api_health_check():
return {"status": "ok", "service": "api-gateway"}