# CORS Middleware

*noun*

say it: **“KORZ MID-ul-wair”** **/kɔrz ˈmɪdəlwɛr/**

FastAPI's CORSMiddleware, which adds the headers that tell browsers which other sites' pages may call your API.

## What is **CORS Middleware**?

`CORSMiddleware` lets web pages on other domains call your API from the browser.

```python
app.add_middleware(CORSMiddleware, allow_origins=['https://www.example.com'], allow_methods=['*'])
```

## In a sentence

- “The **CORS middleware** allows one origin, never \*.”
- “**CORS middleware** lets the coffee club's web page, at another address, call the API.”

Level: Journeyman · [More FastAPI terms at this level](https://www.ask-codey.com/glossary?category=fastapi&level=3)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/cors-middleware
