Skip to content

Instantly share code, notes, and snippets.

@nomanHasan
Last active December 19, 2017 15:37
Show Gist options
  • Save nomanHasan/6ae43c93124d25720b4adc0e1405b4ef to your computer and use it in GitHub Desktop.
Save nomanHasan/6ae43c93124d25720b4adc0e1405b4ef to your computer and use it in GitHub Desktop.
CORS configuration
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "http://localhost:4200");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment