fids/subscription-domain/subscription-manager/src/api/main.py

27 lines
876 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from src.api.db import Base, engine
from src.api.routes import health, messages, notifications, subscriptions
Base.metadata.create_all(bind=engine)
app = FastAPI(title="Subscription Information API")
app.include_router(subscriptions.router, prefix="/subscriptions")
app.include_router(notifications.router, prefix="/notifications")
app.include_router(messages.router, prefix="/messages")
app.include_router(health.router, prefix="/health")
app.add_middleware(
CORSMiddleware,
allow_origins=[
"https://fids.slc.ar",
"https://airport.fids.slc.ar",
"http://localhost:8080",
"http://localhost:8081",
"http://localhost:3000",
],
allow_credentials=True,
allow_methods=["POST", "GET", "PUT", "DELETE", "OPTIONS"],
allow_headers=["*"],
)