mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-30 12:09:52 -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 { response } from '../response'
|
||||||
import { errors } from '../errors'
|
import { errors } from '../errors'
|
||||||
|
import { Router } from 'express'
|
||||||
|
|
||||||
const Router = require('express').Router
|
const BaseRouter = Router()
|
||||||
const baseRouter = module.exports = Router()
|
|
||||||
|
|
||||||
// get index
|
// get index
|
||||||
baseRouter.get('/', response.showIndex)
|
BaseRouter.get('/', response.showIndex)
|
||||||
// get 403 forbidden
|
// get 403 forbidden
|
||||||
baseRouter.get('/403', function (req, res) {
|
BaseRouter.get('/403', function (req, res) {
|
||||||
errors.errorForbidden(res)
|
errors.errorForbidden(res)
|
||||||
})
|
})
|
||||||
// get 404 not found
|
// get 404 not found
|
||||||
baseRouter.get('/404', function (req, res) {
|
BaseRouter.get('/404', function (req, res) {
|
||||||
errors.errorNotFound(res)
|
errors.errorNotFound(res)
|
||||||
})
|
})
|
||||||
// get 500 internal error
|
// get 500 internal error
|
||||||
baseRouter.get('/500', function (req, res) {
|
BaseRouter.get('/500', function (req, res) {
|
||||||
errors.errorInternalError(res)
|
errors.errorInternalError(res)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export { BaseRouter }
|
||||||
|
|
Loading…
Reference in a new issue