aboutsummaryrefslogtreecommitdiffhomepage
path: root/controllers/api/v1/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-02-04 21:16:27 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-02-04 21:23:06 +0100
commita5fa04b0cce851f680a45055f57ed2c3d22f1c82 (patch)
tree0749c4d6889d7cf250110f9ff59a8cd22ee8a480 /controllers/api/v1/pods.js
parentc173e56520b0fe4206b9ea8049b6add40bfeabcd (diff)
downloadPeerTube-a5fa04b0cce851f680a45055f57ed2c3d22f1c82.tar.gz
PeerTube-a5fa04b0cce851f680a45055f57ed2c3d22f1c82.tar.zst
PeerTube-a5fa04b0cce851f680a45055f57ed2c3d22f1c82.zip
Split misc middleware
Diffstat (limited to 'controllers/api/v1/pods.js')
-rw-r--r--controllers/api/v1/pods.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/controllers/api/v1/pods.js b/controllers/api/v1/pods.js
index 82d8d7f08..3e457ec57 100644
--- a/controllers/api/v1/pods.js
+++ b/controllers/api/v1/pods.js
@@ -7,21 +7,22 @@
7 var logger = require('../../../helpers/logger') 7 var logger = require('../../../helpers/logger')
8 var friends = require('../../../lib/friends') 8 var friends = require('../../../lib/friends')
9 var middleware = require('../../../middlewares') 9 var middleware = require('../../../middlewares')
10 var miscMiddleware = middleware.misc 10 var cacheMiddleware = middleware.cache
11 var Pods = require('../../../models/pods') 11 var Pods = require('../../../models/pods')
12 var reqValidator = middleware.reqValidators.pods 12 var reqValidator = middleware.reqValidators.pods
13 var secureMiddleware = middleware.secure
13 var secureRequest = middleware.reqValidators.remote.secureRequest 14 var secureRequest = middleware.reqValidators.remote.secureRequest
14 var utils = require('../../../helpers/utils') 15 var utils = require('../../../helpers/utils')
15 var Videos = require('../../../models/videos') 16 var Videos = require('../../../models/videos')
16 17
17 var router = express.Router() 18 var router = express.Router()
18 19
19 router.get('/', miscMiddleware.cache(false), listPods) 20 router.get('/', cacheMiddleware.cache(false), listPods)
20 router.post('/', reqValidator.podsAdd, miscMiddleware.cache(false), addPods) 21 router.post('/', reqValidator.podsAdd, cacheMiddleware.cache(false), addPods)
21 router.get('/makefriends', reqValidator.makeFriends, miscMiddleware.cache(false), makeFriends) 22 router.get('/makefriends', reqValidator.makeFriends, cacheMiddleware.cache(false), makeFriends)
22 router.get('/quitfriends', miscMiddleware.cache(false), quitFriends) 23 router.get('/quitfriends', cacheMiddleware.cache(false), quitFriends)
23 // Post because this is a secured request 24 // Post because this is a secured request
24 router.post('/remove', secureRequest, miscMiddleware.decryptBody, removePods) 25 router.post('/remove', secureRequest, secureMiddleware.decryptBody, removePods)
25 26
26 // --------------------------------------------------------------------------- 27 // ---------------------------------------------------------------------------
27 28