diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2015-11-07 14:16:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2015-11-07 14:16:26 +0100 |
commit | 34ca3b5225479a5da986c86ee4c42a73ae6df5ad (patch) | |
tree | 561ba5ae1adccd5729305a8cc17d13d24a0c2ddb /server.js | |
parent | f5a60a5138135a3412dfbcfd6e564f7aa47a55c2 (diff) | |
download | PeerTube-34ca3b5225479a5da986c86ee4c42a73ae6df5ad.tar.gz PeerTube-34ca3b5225479a5da986c86ee4c42a73ae6df5ad.tar.zst PeerTube-34ca3b5225479a5da986c86ee4c42a73ae6df5ad.zip |
Add requests parameters validations
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | // ----------- Node modules ----------- | 7 | // ----------- Node modules ----------- |
8 | var express = require('express') | 8 | var express = require('express') |
9 | var expressValidator = require('express-validator') | ||
9 | var path = require('path') | 10 | var path = require('path') |
10 | var morgan = require('morgan') | 11 | var morgan = require('morgan') |
11 | var bodyParser = require('body-parser') | 12 | var bodyParser = require('body-parser') |
@@ -47,6 +48,7 @@ | |||
47 | app.use(bodyParser.json()) | 48 | app.use(bodyParser.json()) |
48 | app.use(multer({ dest: uploads })) | 49 | app.use(multer({ dest: uploads })) |
49 | app.use(bodyParser.urlencoded({ extended: false })) | 50 | app.use(bodyParser.urlencoded({ extended: false })) |
51 | app.use(expressValidator()) | ||
50 | 52 | ||
51 | // ----------- Views, routes and static files ----------- | 53 | // ----------- Views, routes and static files ----------- |
52 | 54 | ||