mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 10:16:32 -05:00
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:
parent
c4178e5d77
commit
621905bc97
1 changed files with 8 additions and 6 deletions
|
@ -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 }
|
||||
|
|
Loading…
Reference in a new issue