aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-22 11:15:17 +0200
committerChocobozzz <me@florianbigard.com>2021-07-22 11:48:24 +0200
commit20bafcb61bee2a9a10a500908850c9a7d5e3c8c5 (patch)
tree18d0e8eb693b0fce88b21b282ea6f28836763fe6 /server/controllers/feeds.ts
parent13e13377918b65c30b9334920fef4b43e70b964e (diff)
downloadPeerTube-20bafcb61bee2a9a10a500908850c9a7d5e3c8c5.tar.gz
PeerTube-20bafcb61bee2a9a10a500908850c9a7d5e3c8c5.tar.zst
PeerTube-20bafcb61bee2a9a10a500908850c9a7d5e3c8c5.zip
Move apicache in peertube
Allow us to upgrade to node 16
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r--server/controllers/feeds.ts24
1 files changed, 8 insertions, 16 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts
index 435b12193..cdc6bfb8b 100644
--- a/server/controllers/feeds.ts
+++ b/server/controllers/feeds.ts
@@ -16,20 +16,20 @@ import {
16 videosSortValidator, 16 videosSortValidator,
17 videoSubscriptionFeedsValidator 17 videoSubscriptionFeedsValidator
18} from '../middlewares' 18} from '../middlewares'
19import { cacheRoute } from '../middlewares/cache' 19import { cacheRouteFactory } from '../middlewares/cache/cache'
20import { VideoModel } from '../models/video/video' 20import { VideoModel } from '../models/video/video'
21import { VideoCommentModel } from '../models/video/video-comment' 21import { VideoCommentModel } from '../models/video/video-comment'
22 22
23const feedsRouter = express.Router() 23const feedsRouter = express.Router()
24 24
25const cacheRoute = cacheRouteFactory({
26 headerBlacklist: [ 'Content-Type' ]
27})
28
25feedsRouter.get('/feeds/video-comments.:format', 29feedsRouter.get('/feeds/video-comments.:format',
26 feedsFormatValidator, 30 feedsFormatValidator,
27 setFeedFormatContentType, 31 setFeedFormatContentType,
28 asyncMiddleware(cacheRoute({ 32 cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS),
29 headerBlacklist: [
30 'Content-Type'
31 ]
32 })(ROUTE_CACHE_LIFETIME.FEEDS)),
33 asyncMiddleware(videoFeedsValidator), 33 asyncMiddleware(videoFeedsValidator),
34 asyncMiddleware(videoCommentsFeedsValidator), 34 asyncMiddleware(videoCommentsFeedsValidator),
35 asyncMiddleware(generateVideoCommentsFeed) 35 asyncMiddleware(generateVideoCommentsFeed)
@@ -40,11 +40,7 @@ feedsRouter.get('/feeds/videos.:format',
40 setDefaultVideosSort, 40 setDefaultVideosSort,
41 feedsFormatValidator, 41 feedsFormatValidator,
42 setFeedFormatContentType, 42 setFeedFormatContentType,
43 asyncMiddleware(cacheRoute({ 43 cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS),
44 headerBlacklist: [
45 'Content-Type'
46 ]
47 })(ROUTE_CACHE_LIFETIME.FEEDS)),
48 commonVideosFiltersValidator, 44 commonVideosFiltersValidator,
49 asyncMiddleware(videoFeedsValidator), 45 asyncMiddleware(videoFeedsValidator),
50 asyncMiddleware(generateVideoFeed) 46 asyncMiddleware(generateVideoFeed)
@@ -55,11 +51,7 @@ feedsRouter.get('/feeds/subscriptions.:format',
55 setDefaultVideosSort, 51 setDefaultVideosSort,
56 feedsFormatValidator, 52 feedsFormatValidator,
57 setFeedFormatContentType, 53 setFeedFormatContentType,
58 asyncMiddleware(cacheRoute({ 54 cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS),
59 headerBlacklist: [
60 'Content-Type'
61 ]
62 })(ROUTE_CACHE_LIFETIME.FEEDS)),
63 commonVideosFiltersValidator, 55 commonVideosFiltersValidator,
64 asyncMiddleware(videoSubscriptionFeedsValidator), 56 asyncMiddleware(videoSubscriptionFeedsValidator),
65 asyncMiddleware(generateVideoFeedForSubscriptions) 57 asyncMiddleware(generateVideoFeedForSubscriptions)