sepia-search-motore-di-rice.../server/controllers/api/index.ts

20 lines
553 B
TypeScript

import * as express from 'express'
import { badRequest } from '../../helpers/utils'
import { searchRouter } from './search-videos'
const apiRouter = express.Router()
apiRouter.use('/', searchRouter)
apiRouter.use('/ping', pong)
apiRouter.use('/*', badRequest)
// ---------------------------------------------------------------------------
export { apiRouter }
// ---------------------------------------------------------------------------
function pong (req: express.Request, res: express.Response) {
return res.send('pong').status(200).end()
}