25 lines
723 B
Python
25 lines
723 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from src.api.db import Base, engine
|
|
from src.api.routes import flights, health
|
|
|
|
Base.metadata.create_all(bind=engine)
|
|
|
|
app = FastAPI(title="Flights Information API")
|
|
app.include_router(flights.router, prefix="/flights")
|
|
app.include_router(health.router, prefix="/health")
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=[
|
|
"https://fids.slc.ar",
|
|
"http://localhost:8080",
|
|
"http://localhost",
|
|
"http://localhost:80",
|
|
"http://localhost:81",
|
|
"http://localhost:3000",
|
|
],
|
|
allow_credentials=True,
|
|
allow_methods=["POST", "GET", "PUT", "DELETE", "OPTIONS"],
|
|
allow_headers=["*"],
|
|
)
|