2020-02-13 11:49:03 +01:00
|
|
|
import * as express from 'express'
|
|
|
|
import { badRequest } from '../../helpers/utils'
|
2020-02-18 15:33:21 +01:00
|
|
|
import { searchRouter } from './search-videos'
|
2020-02-13 11:49:03 +01:00
|
|
|
|
|
|
|
const apiRouter = express.Router()
|
|
|
|
|
2020-02-18 15:33:21 +01:00
|
|
|
apiRouter.use('/', searchRouter)
|
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()
|
|
|
|
}
|