added baseRouter.ts

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
Philip Molares 2020-04-12 20:44:52 +02:00 committed by David Mehren
parent c4178e5d77
commit 621905bc97
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -1,20 +1,22 @@
import { response } from '../response'
import { errors } from '../errors'
import { Router } from 'express'
const Router = require('express').Router
const baseRouter = module.exports = Router()
const BaseRouter = Router()
// get index
baseRouter.get('/', response.showIndex)
BaseRouter.get('/', response.showIndex)
// get 403 forbidden
baseRouter.get('/403', function (req, res) {
BaseRouter.get('/403', function (req, res) {
errors.errorForbidden(res)
})
// get 404 not found
baseRouter.get('/404', function (req, res) {
BaseRouter.get('/404', function (req, res) {
errors.errorNotFound(res)
})
// get 500 internal error
baseRouter.get('/500', function (req, res) {
BaseRouter.get('/500', function (req, res) {
errors.errorInternalError(res)
})
export { BaseRouter }