diff --git a/ph/main.py b/ph/main.py index 5707374..e19efac 100644 --- a/ph/main.py +++ b/ph/main.py @@ -1,4 +1,5 @@ from fastapi import FastAPI, Request, status +from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates @@ -15,6 +16,13 @@ "url": "https://github.com/PacketHelper/packet-helper-next/blob/main/LICENSE", }, ) +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) app.mount("/static", StaticFiles(directory="static"), name="static") app.include_router(api, prefix="/api", tags=["api"])