Migrate historyRouter.js and baseRouter.js to TypeScript

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-12 17:39:35 +02:00
parent 0ca8e2dc7d
commit d44144630f
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
3 changed files with 18 additions and 24 deletions

20
lib/web/baseRouter.ts Normal file
View file

@ -0,0 +1,20 @@
import { response } from '../response'
import { errors } from '../errors'
const Router = require('express').Router
const baseRouter = module.exports = 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)
})