aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/index.js4
-rw-r--r--server/middlewares/reqValidators/index.js19
-rw-r--r--server/middlewares/validators/index.js19
-rw-r--r--server/middlewares/validators/pagination.js (renamed from server/middlewares/reqValidators/pagination.js)4
-rw-r--r--server/middlewares/validators/pods.js (renamed from server/middlewares/reqValidators/pods.js)4
-rw-r--r--server/middlewares/validators/remote.js (renamed from server/middlewares/reqValidators/remote.js)4
-rw-r--r--server/middlewares/validators/sort.js (renamed from server/middlewares/reqValidators/sort.js)4
-rw-r--r--server/middlewares/validators/utils.js (renamed from server/middlewares/reqValidators/utils.js)4
-rw-r--r--server/middlewares/validators/videos.js (renamed from server/middlewares/reqValidators/videos.js)4
9 files changed, 33 insertions, 33 deletions
diff --git a/server/middlewares/index.js b/server/middlewares/index.js
index 01043cd85..0a233e701 100644
--- a/server/middlewares/index.js
+++ b/server/middlewares/index.js
@@ -2,7 +2,7 @@
2 2
3const oauth = require('./oauth') 3const oauth = require('./oauth')
4const pagination = require('./pagination') 4const pagination = require('./pagination')
5const reqValidatorsMiddleware = require('./reqValidators') 5const validatorsMiddleware = require('./validators')
6const search = require('./search') 6const search = require('./search')
7const sort = require('./sort') 7const sort = require('./sort')
8const secureMiddleware = require('./secure') 8const secureMiddleware = require('./secure')
@@ -10,7 +10,7 @@ const secureMiddleware = require('./secure')
10const middlewares = { 10const middlewares = {
11 oauth: oauth, 11 oauth: oauth,
12 pagination: pagination, 12 pagination: pagination,
13 reqValidators: reqValidatorsMiddleware, 13 validators: validatorsMiddleware,
14 search: search, 14 search: search,
15 sort: sort, 15 sort: sort,
16 secure: secureMiddleware 16 secure: secureMiddleware
diff --git a/server/middlewares/reqValidators/index.js b/server/middlewares/reqValidators/index.js
deleted file mode 100644
index be68f6a29..000000000
--- a/server/middlewares/reqValidators/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
1'use strict'
2
3const paginationReqValidators = require('./pagination')
4const podsReqValidators = require('./pods')
5const remoteReqValidators = require('./remote')
6const sortReqValidators = require('./sort')
7const videosReqValidators = require('./videos')
8
9const reqValidators = {
10 pagination: paginationReqValidators,
11 pods: podsReqValidators,
12 remote: remoteReqValidators,
13 sort: sortReqValidators,
14 videos: videosReqValidators
15}
16
17// ---------------------------------------------------------------------------
18
19module.exports = reqValidators
diff --git a/server/middlewares/validators/index.js b/server/middlewares/validators/index.js
new file mode 100644
index 000000000..0471b3f92
--- /dev/null
+++ b/server/middlewares/validators/index.js
@@ -0,0 +1,19 @@
1'use strict'
2
3const paginationValidators = require('./pagination')
4const podsValidators = require('./pods')
5const remoteValidators = require('./remote')
6const sortValidators = require('./sort')
7const videosValidators = require('./videos')
8
9const validators = {
10 pagination: paginationValidators,
11 pods: podsValidators,
12 remote: remoteValidators,
13 sort: sortValidators,
14 videos: videosValidators
15}
16
17// ---------------------------------------------------------------------------
18
19module.exports = validators
diff --git a/server/middlewares/reqValidators/pagination.js b/server/middlewares/validators/pagination.js
index e598f269a..8e9a01053 100644
--- a/server/middlewares/reqValidators/pagination.js
+++ b/server/middlewares/validators/pagination.js
@@ -3,7 +3,7 @@
3const checkErrors = require('./utils').checkErrors 3const checkErrors = require('./utils').checkErrors
4const logger = require('../../helpers/logger') 4const logger = require('../../helpers/logger')
5 5
6const reqValidatorsPagination = { 6const validatorsPagination = {
7 pagination: pagination 7 pagination: pagination
8} 8}
9 9
@@ -18,4 +18,4 @@ function pagination (req, res, next) {
18 18
19// --------------------------------------------------------------------------- 19// ---------------------------------------------------------------------------
20 20
21module.exports = reqValidatorsPagination 21module.exports = validatorsPagination
diff --git a/server/middlewares/reqValidators/pods.js b/server/middlewares/validators/pods.js
index 78a4b76c1..fda2e865f 100644
--- a/server/middlewares/reqValidators/pods.js
+++ b/server/middlewares/validators/pods.js
@@ -4,7 +4,7 @@ const checkErrors = require('./utils').checkErrors
4const friends = require('../../lib/friends') 4const friends = require('../../lib/friends')
5const logger = require('../../helpers/logger') 5const logger = require('../../helpers/logger')
6 6
7const reqValidatorsPod = { 7const validatorsPod = {
8 makeFriends: makeFriends, 8 makeFriends: makeFriends,
9 podsAdd: podsAdd 9 podsAdd: podsAdd
10} 10}
@@ -38,4 +38,4 @@ function podsAdd (req, res, next) {
38 38
39// --------------------------------------------------------------------------- 39// ---------------------------------------------------------------------------
40 40
41module.exports = reqValidatorsPod 41module.exports = validatorsPod
diff --git a/server/middlewares/reqValidators/remote.js b/server/middlewares/validators/remote.js
index dd8ee5f6e..1be119458 100644
--- a/server/middlewares/reqValidators/remote.js
+++ b/server/middlewares/validators/remote.js
@@ -3,7 +3,7 @@
3const checkErrors = require('./utils').checkErrors 3const checkErrors = require('./utils').checkErrors
4const logger = require('../../helpers/logger') 4const logger = require('../../helpers/logger')
5 5
6const reqValidatorsRemote = { 6const validatorsRemote = {
7 dataToDecrypt: dataToDecrypt, 7 dataToDecrypt: dataToDecrypt,
8 remoteVideos: remoteVideos, 8 remoteVideos: remoteVideos,
9 signature: signature 9 signature: signature
@@ -38,4 +38,4 @@ function signature (req, res, next) {
38 38
39// --------------------------------------------------------------------------- 39// ---------------------------------------------------------------------------
40 40
41module.exports = reqValidatorsRemote 41module.exports = validatorsRemote
diff --git a/server/middlewares/reqValidators/sort.js b/server/middlewares/validators/sort.js
index 06e680ef4..56b63cc8b 100644
--- a/server/middlewares/reqValidators/sort.js
+++ b/server/middlewares/validators/sort.js
@@ -4,7 +4,7 @@ const checkErrors = require('./utils').checkErrors
4const constants = require('../../initializers/constants') 4const constants = require('../../initializers/constants')
5const logger = require('../../helpers/logger') 5const logger = require('../../helpers/logger')
6 6
7const reqValidatorsSort = { 7const validatorsSort = {
8 videosSort: videosSort 8 videosSort: videosSort
9} 9}
10 10
@@ -20,4 +20,4 @@ function videosSort (req, res, next) {
20 20
21// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
22 22
23module.exports = reqValidatorsSort 23module.exports = validatorsSort
diff --git a/server/middlewares/reqValidators/utils.js b/server/middlewares/validators/utils.js
index 198ed8d26..f6e5b2b38 100644
--- a/server/middlewares/reqValidators/utils.js
+++ b/server/middlewares/validators/utils.js
@@ -4,7 +4,7 @@ const util = require('util')
4 4
5const logger = require('../../helpers/logger') 5const logger = require('../../helpers/logger')
6 6
7const reqValidatorsUtils = { 7const validatorsUtils = {
8 checkErrors: checkErrors 8 checkErrors: checkErrors
9} 9}
10 10
@@ -22,4 +22,4 @@ function checkErrors (req, res, next, statusCode) {
22 22
23// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------
24 24
25module.exports = reqValidatorsUtils 25module.exports = validatorsUtils
diff --git a/server/middlewares/reqValidators/videos.js b/server/middlewares/validators/videos.js
index 452fbc859..24e2299dc 100644
--- a/server/middlewares/reqValidators/videos.js
+++ b/server/middlewares/validators/videos.js
@@ -9,7 +9,7 @@ const logger = require('../../helpers/logger')
9 9
10const Video = mongoose.model('Video') 10const Video = mongoose.model('Video')
11 11
12const reqValidatorsVideos = { 12const validatorsVideos = {
13 videosAdd: videosAdd, 13 videosAdd: videosAdd,
14 videosGet: videosGet, 14 videosGet: videosGet,
15 videosRemove: videosRemove, 15 videosRemove: videosRemove,
@@ -94,4 +94,4 @@ function videosSearch (req, res, next) {
94 94
95// --------------------------------------------------------------------------- 95// ---------------------------------------------------------------------------
96 96
97module.exports = reqValidatorsVideos 97module.exports = validatorsVideos