2020-04-12 11:39:35 -04:00
|
|
|
import { response } from '../response'
|
|
|
|
import { errors } from '../errors'
|
2020-04-12 14:44:52 -04:00
|
|
|
import { Router } from 'express'
|
2017-04-11 17:38:54 -04:00
|
|
|
|
2020-04-12 14:44:52 -04:00
|
|
|
const BaseRouter = Router()
|
2017-04-11 17:38:54 -04:00
|
|
|
|
|
|
|
// get index
|
2020-04-12 14:44:52 -04:00
|
|
|
BaseRouter.get('/', response.showIndex)
|
2017-04-11 17:38:54 -04:00
|
|
|
// get 403 forbidden
|
2020-04-12 14:44:52 -04:00
|
|
|
BaseRouter.get('/403', function (req, res) {
|
2019-10-27 08:51:53 -04:00
|
|
|
errors.errorForbidden(res)
|
2017-04-11 17:38:54 -04:00
|
|
|
})
|
|
|
|
// get 404 not found
|
2020-04-12 14:44:52 -04:00
|
|
|
BaseRouter.get('/404', function (req, res) {
|
2019-10-27 08:51:53 -04:00
|
|
|
errors.errorNotFound(res)
|
2017-04-11 17:38:54 -04:00
|
|
|
})
|
|
|
|
// get 500 internal error
|
2020-04-12 14:44:52 -04:00
|
|
|
BaseRouter.get('/500', function (req, res) {
|
2019-10-27 08:51:53 -04:00
|
|
|
errors.errorInternalError(res)
|
2017-04-11 17:38:54 -04:00
|
|
|
})
|
2020-04-12 14:44:52 -04:00
|
|
|
|
|
|
|
export { BaseRouter }
|