Add express-validator library

This commit is contained in:
rui hildt 2020-05-11 00:48:27 +02:00
parent 03815bd2f6
commit 48c0d05bcb
3 changed files with 18 additions and 0 deletions

View File

@ -24,6 +24,9 @@ server.use(
}),
);
// TODO: Add validation to all requests
server.use(expressValidator());
server.use('/api/accounts', accountsRoute);
server.use('/api/meetings', meetingsRoute);
server.use('/api/participants', participantsRoute);

14
package-lock.json generated
View File

@ -528,6 +528,15 @@
"vary": "~1.1.2"
}
},
"express-validator": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.4.1.tgz",
"integrity": "sha512-9lVLCv9n735j6LjZwrINKhfv30ek1U4LVy/2jU1j4QotQ8A72Saw63wTu8/zXGZajP3scqf46PJxqquGF340Bg==",
"requires": {
"lodash": "^4.17.15",
"validator": "^12.1.0"
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -2353,6 +2362,11 @@
"spdx-expression-parse": "^3.0.0"
}
},
"validator": {
"version": "12.2.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-12.2.0.tgz",
"integrity": "sha512-jJfE/DW6tIK1Ek8nCfNFqt8Wb3nzMoAbocBF6/Icgg1ZFSBpObdnwVY2jQj6qUqzhx5jc71fpvBWyLGO7Xl+nQ=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",

View File

@ -18,6 +18,7 @@
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-validator": "^6.4.1",
"helmet": "^3.22.0",
"jsonwebtoken": "^8.5.1",
"knex": "^0.21.1",