1
0
Fork 0
peertube/server/controllers/feeds/index.ts
2023-07-26 08:37:50 +02:00

25 lines
767 B
TypeScript

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
}