Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Created October 22, 2018 00:21
Show Gist options
  • Save Vheissu/d54073d5a60854c2a8e2c6c04e0b8282 to your computer and use it in GitHub Desktop.
Save Vheissu/d54073d5a60854c2a8e2c6c04e0b8282 to your computer and use it in GitHub Desktop.
const crossDomainHandler = (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