diff options
Diffstat (limited to 'middlewares/reqValidators/pods.js')
-rw-r--r-- | middlewares/reqValidators/pods.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/middlewares/reqValidators/pods.js b/middlewares/reqValidators/pods.js new file mode 100644 index 000000000..31eaf8449 --- /dev/null +++ b/middlewares/reqValidators/pods.js | |||
@@ -0,0 +1,19 @@ | |||
1 | ;(function () { | ||
2 | 'use strict' | ||
3 | |||
4 | var checkErrors = require('./utils').checkErrors | ||
5 | var logger = require('../../src/logger') | ||
6 | |||
7 | var pods = {} | ||
8 | |||
9 | pods.podsAdd = function (req, res, next) { | ||
10 | req.checkBody('data.url', 'Should have an url').notEmpty().isURL({ require_protocol: true }) | ||
11 | req.checkBody('data.publicKey', 'Should have a public key').notEmpty() | ||
12 | |||
13 | logger.debug('Checking podsAdd parameters', { parameters: req.body }) | ||
14 | |||
15 | checkErrors(req, res, next) | ||
16 | } | ||
17 | |||
18 | module.exports = pods | ||
19 | })() | ||