Skip to content

Instantly share code, notes, and snippets.

@pablocattaneo
Created October 7, 2019 11:09
Show Gist options
  • Save pablocattaneo/e83b373d994913f6e39e591089c1af8d to your computer and use it in GitHub Desktop.
Save pablocattaneo/e83b373d994913f6e39e591089c1af8d to your computer and use it in GitHub Desktop.
// index.js
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET, POST, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment