Showing
1 changed file
with
3 additions
and
1 deletions
@@ -46,7 +46,9 @@ app.use(cookieSession({ | @@ -46,7 +46,9 @@ app.use(cookieSession({ | ||
46 | app.use(compression()); | 46 | app.use(compression()); |
47 | app.use(favicon(path.join(__dirname, '/favicon.ico'))); | 47 | app.use(favicon(path.join(__dirname, '/favicon.ico'))); |
48 | app.use(Express.static(path.join(__dirname, 'public'))); | 48 | app.use(Express.static(path.join(__dirname, 'public'))); |
49 | -app.use(bodyParser.json()); | 49 | +app.use(bodyParser.json({ |
50 | + limit: 1 * 1024 * 1024 // 限制请求长度1m | ||
51 | +})); | ||
50 | app.use(bodyParser.urlencoded({extended: false})); | 52 | app.use(bodyParser.urlencoded({extended: false})); |
51 | app.use(cookieParser()); | 53 | app.use(cookieParser()); |
52 | app.use(multipartMiddleware); | 54 | app.use(multipartMiddleware); |
-
Please register or login to post a comment