# CORS in Express

*noun*

say it: **“KORZ in ek-SPRES”** **/kɔrz ɪn ɪkˈsprɛs/**

The cors middleware for Express, which adds the headers that let web pages on other origins call your API.

## What is **CORS in Express**?

The **cors** middleware adds headers that let web pages on other domains call your API.

```javascript
import cors from 'cors';
app.use(cors({ origin: 'https://www.example.com' }));
```

## In a sentence

- “Without **CORS in Express**, the browser hid every answer from the front end on another port.”
- “**CORS in Express** is one line: app.use(cors({ origin: "http://localhost:5173" })).”

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

Updated: November 19, 2026

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