mirror of
https://framagit.org/framasoft/peertube/search-index/
synced 2024-12-13 17:46:16 +01:00
24 lines
736 B
TypeScript
24 lines
736 B
TypeScript
import * as express from 'express'
|
|
import { badRequest } from '../../helpers/utils'
|
|
import { configRouter } from './config'
|
|
import { searchChannelsRouter } from './search-channels'
|
|
import { searchVideosRouter } from './search-videos'
|
|
|
|
const apiRouter = express.Router()
|
|
|
|
apiRouter.use('/', configRouter)
|
|
apiRouter.use('/', searchVideosRouter)
|
|
apiRouter.use('/', searchChannelsRouter)
|
|
apiRouter.use('/ping', pong)
|
|
apiRouter.use('/*', badRequest)
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export { apiRouter }
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function pong (req: express.Request, res: express.Response) {
|
|
return res.send('pong').status(200).end()
|
|
}
|