mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
Migrate historyRouter.js and baseRouter.js to TypeScript
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
0ca8e2dc7d
commit
d44144630f
3 changed files with 18 additions and 24 deletions
20
lib/web/baseRouter.ts
Normal file
20
lib/web/baseRouter.ts
Normal 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)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue