hedgedoc/lib/web/baseRouter.ts
Philip Molares 621905bc97
added baseRouter.ts
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:10 +02:00

22 lines
515 B
TypeScript

import { response } from '../response'
import { errors } from '../errors'
import { Router } from 'express'
const BaseRouter = Router()
// get index
BaseRouter.get('/', response.showIndex)
// get 403 forbidden
BaseRouter.get('/403', function (req, res) {
errors.errorForbidden(res)
})
// get 404 not found
BaseRouter.get('/404', function (req, res) {
errors.errorNotFound(res)
})
// get 500 internal error
BaseRouter.get('/500', function (req, res) {
errors.errorInternalError(res)
})
export { BaseRouter }