Skip to content

Instantly share code, notes, and snippets.

@flesch
Created August 18, 2012 15:27
Show Gist options
  • Save flesch/3387660 to your computer and use it in GitHub Desktop.
Save flesch/3387660 to your computer and use it in GitHub Desktop.
CORS headers (Express)
app.get "*", (request, response, next) ->
response.header "Access-Control-Allow-Origin", "*"
response.header "Access-Control-Allow-Methods", "GET, SETTINGS"
response.header "Access-Control-Allow-Credentials", "true"
response.header "Access-Control-Max-Age", "0"
response.header "Cache-Control", "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0"
return next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment