27 lines
611 B
Python
27 lines
611 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from app.routers import calculation
|
|
|
|
app = FastAPI(title="Glass Cutting Optimization API")
|
|
|
|
origins = [
|
|
"http://localhost",
|
|
"http://localhost:3000",
|
|
"http://localhost:5173",
|
|
"https://govorov.itqop.pw"
|
|
]
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(calculation.router, prefix="/api")
|
|
|
|
@app.get("/")
|
|
async def read_root():
|
|
return {"message": "Welcome to the Glass Cutting Optimization API"}
|