peertube-plugin-livechat/server/lib/routers/index.ts
2021-04-09 21:28:16 +02:00

18 lines
553 B
TypeScript

import type { NextFunction, Request, Response } from 'express'
import { initWebchatRouter } from './webchat'
import { initSettingsRouter } from './settings'
async function initRouters (options: RegisterServerOptions): Promise<void> {
const { getRouter } = options
const router = getRouter()
router.get('/ping', (req: Request, res: Response, _next: NextFunction) => res.json({ message: 'pong' }))
router.use('/webchat', await initWebchatRouter(options))
router.use('/settings', await initSettingsRouter(options))
}
export {
initRouters
}