diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-02-04 21:16:27 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-02-04 21:23:06 +0100 |
commit | a5fa04b0cce851f680a45055f57ed2c3d22f1c82 (patch) | |
tree | 0749c4d6889d7cf250110f9ff59a8cd22ee8a480 /controllers/api/v1/videos.js | |
parent | c173e56520b0fe4206b9ea8049b6add40bfeabcd (diff) | |
download | PeerTube-a5fa04b0cce851f680a45055f57ed2c3d22f1c82.tar.gz PeerTube-a5fa04b0cce851f680a45055f57ed2c3d22f1c82.tar.zst PeerTube-a5fa04b0cce851f680a45055f57ed2c3d22f1c82.zip |
Split misc middleware
Diffstat (limited to 'controllers/api/v1/videos.js')
-rw-r--r-- | controllers/api/v1/videos.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/controllers/api/v1/videos.js b/controllers/api/v1/videos.js index d2e7e8825..7792059ca 100644 --- a/controllers/api/v1/videos.js +++ b/controllers/api/v1/videos.js | |||
@@ -9,7 +9,7 @@ | |||
9 | var logger = require('../../../helpers/logger') | 9 | var logger = require('../../../helpers/logger') |
10 | var friends = require('../../../lib/friends') | 10 | var friends = require('../../../lib/friends') |
11 | var middleware = require('../../../middlewares') | 11 | var middleware = require('../../../middlewares') |
12 | var miscMiddleware = middleware.misc | 12 | var cacheMiddleware = middleware.cache |
13 | var reqValidator = middleware.reqValidators.videos | 13 | var reqValidator = middleware.reqValidators.videos |
14 | var Videos = require('../../../models/videos') // model | 14 | var Videos = require('../../../models/videos') // model |
15 | var videos = require('../../../lib/videos') | 15 | var videos = require('../../../lib/videos') |
@@ -38,11 +38,11 @@ | |||
38 | 38 | ||
39 | var reqFiles = multer({ storage: storage }).fields([{ name: 'input_video', maxCount: 1 }]) | 39 | var reqFiles = multer({ storage: storage }).fields([{ name: 'input_video', maxCount: 1 }]) |
40 | 40 | ||
41 | router.get('/', miscMiddleware.cache(false), listVideos) | 41 | router.get('/', cacheMiddleware.cache(false), listVideos) |
42 | router.post('/', reqFiles, reqValidator.videosAdd, miscMiddleware.cache(false), addVideo) | 42 | router.post('/', reqFiles, reqValidator.videosAdd, cacheMiddleware.cache(false), addVideo) |
43 | router.get('/:id', reqValidator.videosGet, miscMiddleware.cache(false), getVideos) | 43 | router.get('/:id', reqValidator.videosGet, cacheMiddleware.cache(false), getVideos) |
44 | router.delete('/:id', reqValidator.videosRemove, miscMiddleware.cache(false), removeVideo) | 44 | router.delete('/:id', reqValidator.videosRemove, cacheMiddleware.cache(false), removeVideo) |
45 | router.get('/search/:name', reqValidator.videosSearch, miscMiddleware.cache(false), searchVideos) | 45 | router.get('/search/:name', reqValidator.videosSearch, cacheMiddleware.cache(false), searchVideos) |
46 | 46 | ||
47 | // --------------------------------------------------------------------------- | 47 | // --------------------------------------------------------------------------- |
48 | 48 | ||