Skip to content

Instantly share code, notes, and snippets.

@nurfarazi
Created March 16, 2016 12:08
Show Gist options
  • Save nurfarazi/2f76e8f2e6bf884e969e to your computer and use it in GitHub Desktop.
Save nurfarazi/2f76e8f2e6bf884e969e to your computer and use it in GitHub Desktop.
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type, Authorization');
res.setHeader('Access-Control-Allow-Headers', 'x-access-token, token');
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment