mirror of
https://github.com/UofCBaja/BajaCloud.git
synced 2025-06-15 05:04:17 -06:00
fix(main): added middleware for post request
This commit is contained in:
parent
6e14f9f556
commit
25bb3e77dc
9
main.py
9
main.py
@ -1,5 +1,6 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from pydantic import BaseModel
|
||||
|
||||
from InterviewBooking.NoSheet import NoSheet
|
||||
@ -16,6 +17,14 @@ if not os.path.isfile(file_name):
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"], # This allows all origins
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"], # Allow all methods (GET, POST, OPTIONS, etc.)
|
||||
allow_headers=["*"], # Allow all headers
|
||||
)
|
||||
"""
|
||||
YOU MUST ADD CORS MANUALLY TO ANY METHOD USE THIS TEMPLATE
|
||||
ADD TO JSONRESPONSE
|
||||
|
Loading…
x
Reference in New Issue
Block a user