Adding CORS to express JS

This commit is contained in:
Alexander Blair
2017-02-21 17:00:49 -08:00
parent 0d8afd850f
commit f341363754
+2
View File
@@ -9,6 +9,7 @@ const cnUtil = require('cryptonote-util');
let bodyParser = require('body-parser');
let jwt = require('jsonwebtoken'); // used to create, sign, and verify tokens
const crypto = require('crypto');
let cors = require('cors');
let addressBase58Prefix = cnUtil.address_decode(new Buffer(global.config.pool.address));
@@ -21,6 +22,7 @@ if (cluster.isMaster) {
threadName = "(Worker " + cluster.worker.id + " - " + process.pid + ") ";
}
app.use(cors());
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());