Adding CORS to express JS

master
Alexander Blair 7 years ago
parent 0d8afd850f
commit f341363754

@ -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());

Loading…
Cancel
Save