diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2015-11-07 18:40:13 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2015-11-07 18:40:13 +0100 |
commit | b60035d8e86b712e586550f762c26caae353dc0e (patch) | |
tree | a6dc088e5e48f93eb129e40672a7bea0d230a97c /routes/api/v1/videos.js | |
parent | e85782f7da44267e11714a63567feb7e0127126e (diff) | |
download | PeerTube-b60035d8e86b712e586550f762c26caae353dc0e.tar.gz PeerTube-b60035d8e86b712e586550f762c26caae353dc0e.tar.zst PeerTube-b60035d8e86b712e586550f762c26caae353dc0e.zip |
Middleware refractoring
Diffstat (limited to 'routes/api/v1/videos.js')
-rw-r--r-- | routes/api/v1/videos.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/routes/api/v1/videos.js b/routes/api/v1/videos.js index 06b248244..33c565437 100644 --- a/routes/api/v1/videos.js +++ b/routes/api/v1/videos.js | |||
@@ -4,7 +4,8 @@ | |||
4 | var express = require('express') | 4 | var express = require('express') |
5 | var router = express.Router() | 5 | var router = express.Router() |
6 | var middleware = require('../../../middlewares') | 6 | var middleware = require('../../../middlewares') |
7 | var reqValidator = require('../../../middlewares/reqValidators').videos | 7 | var miscMiddleware = middleware.misc |
8 | var reqValidator = middleware.reqValidators.videos | ||
8 | var videos = require('../../../src/videos') | 9 | var videos = require('../../../src/videos') |
9 | 10 | ||
10 | function listVideos (req, res, next) { | 11 | function listVideos (req, res, next) { |
@@ -52,11 +53,11 @@ | |||
52 | }) | 53 | }) |
53 | } | 54 | } |
54 | 55 | ||
55 | router.get('/', middleware.cache(false), listVideos) | 56 | router.get('/', miscMiddleware.cache(false), listVideos) |
56 | router.post('/', reqValidator.videosAdd, middleware.cache(false), addVideos) | 57 | router.post('/', reqValidator.videosAdd, miscMiddleware.cache(false), addVideos) |
57 | router.get('/search/:name', reqValidator.videosSearch, middleware.cache(false), searchVideos) | 58 | router.get('/search/:name', reqValidator.videosSearch, miscMiddleware.cache(false), searchVideos) |
58 | router.get('/:id', reqValidator.videosGet, middleware.cache(false), getVideos) | 59 | router.get('/:id', reqValidator.videosGet, miscMiddleware.cache(false), getVideos) |
59 | router.delete('/:id', reqValidator.videosRemove, middleware.cache(false), removeVideo) | 60 | router.delete('/:id', reqValidator.videosRemove, miscMiddleware.cache(false), removeVideo) |
60 | 61 | ||
61 | module.exports = router | 62 | module.exports = router |
62 | })() | 63 | })() |