govorov/backend/app/main.py

27 lines
611 B
Python
Raw Normal View History

2025-04-07 09:02:54 +02:00
from fastapi import FastAPI
2025-04-07 09:18:31 +02:00
from fastapi.middleware.cors import CORSMiddleware
from app.routers import calculation
2025-04-07 09:02:54 +02:00
app = FastAPI(title="Glass Cutting Optimization API")
origins = [
2025-04-07 09:18:31 +02:00
"http://localhost",
"http://localhost:3000",
"http://localhost:5173",
2025-04-17 16:10:37 +02:00
"https://govorov.itqop.pw"
2025-04-07 09:02:54 +02:00
]
app.add_middleware(
CORSMiddleware,
2025-04-07 09:18:31 +02:00
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
2025-04-07 09:02:54 +02:00
)
2025-04-17 16:10:37 +02:00
app.include_router(calculation.router, prefix="/api")
2025-04-07 09:02:54 +02:00
@app.get("/")
async def read_root():
2025-04-17 16:10:37 +02:00
return {"message": "Welcome to the Glass Cutting Optimization API"}