25 lines
898 B
Python
25 lines
898 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from app.routers import address, contact, proposal, dewar, shipment
|
|
|
|
app = FastAPI()
|
|
|
|
# Apply CORS middleware
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"], # Enable CORS for all origins for now
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# Include your routers
|
|
app.include_router(contact.router, prefix="/contacts", tags=["contacts"])
|
|
app.include_router(address.router, prefix="/return_addresses", tags=["return_addresses"])
|
|
app.include_router(proposal.router, prefix="/proposals", tags=["proposals"])
|
|
app.include_router(dewar.router, prefix="/dewars", tags=["dewars"])
|
|
app.include_router(shipment.router, prefix="/shipments", tags=["shipments"])
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run(app, host="127.0.0.1", port=8000, log_level="debug") |