Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Commit

Permalink
Move body size limit to config
Browse files Browse the repository at this point in the history
  • Loading branch information
phahulin committed Jun 5, 2018
1 parent 075d743 commit 75a8627
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web-dapp/app.js
Expand Up @@ -4,6 +4,7 @@ const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const helmet = require('helmet');
const config = require('./server-config');

const app = express();

Expand All @@ -16,10 +17,9 @@ app.use('/confirm', express.static(path.join(__dirname, 'build')));
app.use('/help', express.static(path.join(__dirname, 'build')));
app.use('/my-addresses', express.static(path.join(__dirname, 'build')));

const BODY_SIZE_LIMIT = '3kb';
// api
app.use(bodyParser.urlencoded({ extended: true, limit: BODY_SIZE_LIMIT }));
app.use(bodyParser.json({ limit: BODY_SIZE_LIMIT }));
app.use(bodyParser.urlencoded({ extended: true, limit: config.bodySizeLimit }));
app.use(bodyParser.json({ limit: config.bodySizeLimit }));

const routes = require('./routes')({});
app.use('/api', routes);
Expand Down
1 change: 1 addition & 0 deletions web-dapp/server-config.js
Expand Up @@ -14,6 +14,7 @@ var cfg = {
type: 'memory',
params: {},
},
bodySizeLimit: '3kb',

rpc: 'http://localhost:8545',

Expand Down

0 comments on commit 75a8627

Please sign in to comment.