Skip to content
Snippets Groups Projects
Commit dfceff3c authored by Kevin Erdiza Yogatama's avatar Kevin Erdiza Yogatama
Browse files

fix on blocked cross local request

parent 7275553b
1 merge request!43KIA -13515016 - Kevin Erdiza Yogatama
This commit is part of merge request !43. Comments created here will be created in the context of that merge request.
......@@ -17,6 +17,14 @@ mongoose.connect(db.url, {
});
mongoose.Promise = global.Promise; // connect to our mongoDB database
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
res.setHeader('Access-Control-Allow-Credentials', true);
next();
});
// get all data/stuff of the body (POST) parameters
app.use(bodyParser.json()); // parse application/json
app.use(bodyParser.json({ type: 'application/vnd.api+json' })); // parse application/vnd.api+json as json
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment