]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - middlewares/reqValidators/pods.js
Infile code reorganization
[github/Chocobozzz/PeerTube.git] / middlewares / reqValidators / pods.js
1 ;(function () {
2 'use strict'
3
4 var checkErrors = require('./utils').checkErrors
5 var logger = require('../../helpers/logger')
6
7 var reqValidatorsPod = {
8 podsAdd: podsAdd
9 }
10
11 function podsAdd (req, res, next) {
12 req.checkBody('data.url', 'Should have an url').notEmpty().isURL({ require_protocol: true })
13 req.checkBody('data.publicKey', 'Should have a public key').notEmpty()
14
15 logger.debug('Checking podsAdd parameters', { parameters: req.body })
16
17 checkErrors(req, res, next)
18 }
19
20 // ---------------------------------------------------------------------------
21
22 module.exports = reqValidatorsPod
23 })()