Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Created October 22, 2018 00:19
Show Gist options
  • Save Vheissu/2d7dc5154327259a4aaf074fea211cfb to your computer and use it in GitHub Desktop.
Save Vheissu/2d7dc5154327259a4aaf074fea211cfb to your computer and use it in GitHub Desktop.
var crossDomainHandlers = (req, res, next) => {
res.header('Access-Control-Allow-Origin', 'http://localhost:8080/');
res.header('Access-Control-Allow-Credentials', true);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment