aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds/index.ts
blob: 19352318d654d12bc62f02dec44521c936edc80b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import express from 'express'
import { CONFIG } from '@server/initializers/config'
import { buildRateLimiter } from '@server/middlewares'
import { commentFeedsRouter } from './comment-feeds'
import { videoFeedsRouter } from './video-feeds'
import { videoPodcastFeedsRouter } from './video-podcast-feeds'

const feedsRouter = express.Router()

const feedsRateLimiter = buildRateLimiter({
  windowMs: CONFIG.RATES_LIMIT.FEEDS.WINDOW_MS,
  max: CONFIG.RATES_LIMIT.FEEDS.MAX
})

feedsRouter.use('/feeds', feedsRateLimiter)

feedsRouter.use('/feeds', commentFeedsRouter)
feedsRouter.use('/feeds', videoFeedsRouter)
feedsRouter.use('/feeds', videoPodcastFeedsRouter)

// ---------------------------------------------------------------------------

export {
  feedsRouter
}