1
0
mirror of https://framagit.org/framasoft/peertube/search-index/ synced 2024-12-13 17:46:16 +01:00
sepia-search-motore-di-rice.../server/controllers/api/index.ts
2020-09-01 11:04:45 +02:00

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()
}