fids/gateway/src/api/main.py

23 lines
703 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from src.api.routes import auth, flights, health, users
app = FastAPI(title="Flights Information API")
app.include_router(flights.router, prefix="/flights")
app.include_router(health.router, prefix="/health")
app.include_router(auth.router, prefix="/auth")
app.include_router(users.router, prefix="/users")
app.add_middleware(
CORSMiddleware,
allow_origins=[
"https://fids.slc.ar",
"http://localhost:8080",
"http://localhost:8081",
"http://localhost:3000",
],
allow_credentials=True,
allow_methods=["POST", "GET", "PUT", "DELETE", "OPTIONS"],
allow_headers=["*"],
)