adding cors

This commit is contained in:
Adolfo Reyna
2021-07-20 09:55:19 -07:00
parent cceaa4a64e
commit dcd161aac8
4 changed files with 28 additions and 0 deletions

View File

@@ -10,6 +10,12 @@ app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cookieParser());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*"); // update to match the domain you will make the request from
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
const bcrypt = require('bcrypt');
const crypto = require('crypto');
const DB = require("./mongoDB.js");