VibeDict

CORS

CORS (Cross-Origin Resource Sharing)

A browser security rule: when you fetch data from a server at a different address (domain), that server has to 'allow' it first.

💡 It's an apartment guest list. The guard (browser) stops visitors from addresses that aren't on the list.

🤖 Say this to your AI

I'm getting a CORS error in the console. Instead of calling the outside API straight from the browser, call it through my own server (an API route). If it's my own server, allow only the exact addresses that need it.

The key word is ‘CORS (Cross-Origin Resource Sharing)’. Including it helps AI understand you much more precisely.

📌 Good to know

Setting '*' to allow every address is easy but risky. List only your own domains.

When to use it

  • When 'blocked by CORS policy' shows up in red in the console
  • When your page calls another server's API directly
  • When it works on localhost but breaks after you deploy

Also called: cors, cors error, cors policy, access-control-allow-origin, origin, cross origin, blocked by cors

Related terms