peertube-plugin-livechat/server/lib/routers/index.ts

16 lines
444 B
TypeScript
Raw Normal View History

2021-04-09 17:29:44 +00:00
import type { NextFunction, Request, Response } from 'express'
import { initWebchatRouter } from './webchat'
2021-04-09 17:39:40 +00:00
async function initRouters (options: RegisterServerOptions): Promise<void> {
const { getRouter } = options
2021-04-09 17:29:44 +00:00
const router = getRouter()
router.get('/ping', (req: Request, res: Response, _next: NextFunction) => res.json({ message: 'pong' }))
2021-04-09 17:39:40 +00:00
router.use('/webchat', await initWebchatRouter(options))
2021-04-09 17:29:44 +00:00
}
export {
initRouters
}