mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-17 05:21:27 +02:00
Adding CORS to express JS
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user