1
0
Fork 0
peertube/server/core/controllers/feeds/index.ts
2023-10-04 15:13:25 +02:00

25 lines
788 B
TypeScript

import express from 'express'
import { CONFIG } from '@server/initializers/config.js'
import { buildRateLimiter } from '@server/middlewares/index.js'
import { commentFeedsRouter } from './comment-feeds.js'
import { videoFeedsRouter } from './video-feeds.js'
import { videoPodcastFeedsRouter } from './video-podcast-feeds.js'
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
}