aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/feeds/index.ts')
-rw-r--r--server/controllers/feeds/index.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/server/controllers/feeds/index.ts b/server/controllers/feeds/index.ts
index e344a1448..19352318d 100644
--- a/server/controllers/feeds/index.ts
+++ b/server/controllers/feeds/index.ts
@@ -1,13 +1,22 @@
1import express from 'express' 1import express from 'express'
2import { CONFIG } from '@server/initializers/config'
3import { buildRateLimiter } from '@server/middlewares'
2import { commentFeedsRouter } from './comment-feeds' 4import { commentFeedsRouter } from './comment-feeds'
3import { videoFeedsRouter } from './video-feeds' 5import { videoFeedsRouter } from './video-feeds'
4import { videoPodcastFeedsRouter } from './video-podcast-feeds' 6import { videoPodcastFeedsRouter } from './video-podcast-feeds'
5 7
6const feedsRouter = express.Router() 8const feedsRouter = express.Router()
7 9
8feedsRouter.use('/', commentFeedsRouter) 10const feedsRateLimiter = buildRateLimiter({
9feedsRouter.use('/', videoFeedsRouter) 11 windowMs: CONFIG.RATES_LIMIT.FEEDS.WINDOW_MS,
10feedsRouter.use('/', videoPodcastFeedsRouter) 12 max: CONFIG.RATES_LIMIT.FEEDS.MAX
13})
14
15feedsRouter.use('/feeds', feedsRateLimiter)
16
17feedsRouter.use('/feeds', commentFeedsRouter)
18feedsRouter.use('/feeds', videoFeedsRouter)
19feedsRouter.use('/feeds', videoPodcastFeedsRouter)
11 20
12// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
13 22