parent
8b3a251e20
commit
ee32bd52a6
@ -18,6 +18,7 @@ module.exports = function getOptions(argv) {
|
||||
passphrase: argv.passphrase || process.env.npm_package_remotedev_passphrase || null
|
||||
},
|
||||
dbOptions: dbOptions,
|
||||
maxRequestBody: argv.passphrase || '16mb',
|
||||
logLevel: argv.logLevel || 3
|
||||
};
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ module.exports.run = function(worker) {
|
||||
var httpServer = worker.httpServer;
|
||||
var scServer = worker.scServer;
|
||||
var store = createStore(worker.options);
|
||||
var limit = worker.options.maxRequestBody;
|
||||
|
||||
httpServer.on('request', app);
|
||||
|
||||
@ -19,8 +20,8 @@ module.exports.run = function(worker) {
|
||||
});
|
||||
|
||||
app.use(cors({ methods: 'POST' }));
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(bodyParser.json({ limit: limit }));
|
||||
app.use(bodyParser.urlencoded({ limit: limit, extended: false }));
|
||||
app.post('/', function(req, res) {
|
||||
if (!req.body) return res.status(404).end();
|
||||
switch(req.body.op) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user