curl -s -o /dev/null -D - -H 'Origin: http://localhost:5173' http://localhost:3000/api | grep -i 'access-control-allow-origin'

Category: Web App Development

curl -s -o /dev/null -D - -H 'Origin: http://localhost:5173' http://localhost:3000/api | grep -i 'access-control-allow-origin'

Check CORS headers with a browser-like Origin

Sends a request carrying the Origin header a browser would send from your Vite dev server, then prints the response headers via -D - while discarding the body. Grepping for access-control-allow-origin shows whether the API will permit the call. A wrong value means CORS is misconfigured.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.