1
0
mirror of https://framagit.org/framasoft/peertube/search-index/ synced 2024-12-14 10:06:02 +01:00
sepia-search-motore-di-rice.../server/controllers/api/index.ts

24 lines
736 B
TypeScript
Raw Normal View History

2020-02-13 11:49:03 +01:00
import * as express from 'express'
import { badRequest } from '../../helpers/utils'
2020-08-27 14:44:21 +02:00
import { configRouter } from './config'
2020-02-19 15:39:35 +01:00
import { searchChannelsRouter } from './search-channels'
2020-08-27 14:44:21 +02:00
import { searchVideosRouter } from './search-videos'
2020-02-13 11:49:03 +01:00
const apiRouter = express.Router()
2020-08-27 14:44:21 +02:00
apiRouter.use('/', configRouter)
2020-02-19 15:39:35 +01:00
apiRouter.use('/', searchVideosRouter)
apiRouter.use('/', searchChannelsRouter)
2020-02-13 11:49:03 +01:00
apiRouter.use('/ping', pong)
apiRouter.use('/*', badRequest)
// ---------------------------------------------------------------------------
export { apiRouter }
// ---------------------------------------------------------------------------
function pong (req: express.Request, res: express.Response) {
return res.send('pong').status(200).end()
}