CORSMiddleware class allows you to configure Cross-Origin Resource Sharing (CORS) headers for your FastrAPI application. This is essential when your API needs to be accessed from web applications running on different domains.
Parameters
List of origins that are allowed to make cross-origin requests. Use
["*"] to allow all origins.HTTP methods that are allowed for cross-origin requests. Use
["*"] to allow all methods.HTTP headers that are allowed in cross-origin requests. Use
["*"] to allow all headers.Whether to allow credentials (cookies, authorization headers) in cross-origin requests.
HTTP headers that should be exposed to the browser in cross-origin responses.
Maximum number of seconds the browser should cache preflight request results.