1app.use(function(req, res, next) {
2 res.setHeader('Access-Control-Allow-Origin', '*');
3 res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
4 res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
5 res.setHeader('Access-Control-Allow-Credentials', true);
6 next();
7});
8