FastAPI - Middleware and Hooks
Given this FastAPI code snippet, what will be the effect of the CORS middleware?
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["https://example.com"],
allow_methods=["GET", "POST"],
allow_headers=["*"],
)
@app.get("/")
async def root():
return {"message": "Hello"}