feat(handlers): Add generic error handler

This commit is contained in:
Khaled Garbaya
2017-10-04 10:36:04 +02:00
committed by Benedikt Rötsch
parent 01fd3cc9b3
commit 67fc0edf62
6 changed files with 42 additions and 30 deletions

View File

@@ -1,9 +1,10 @@
const express = require('express')
const { catchErrors } = require('../handlers/errorHandlers')
const router = express.Router()
/* GET categories listing. */
router.get('/', function (req, res, next) {
/* GET courses listing. */
router.get('/', catchErrors(async function (req, res, next) {
res.render('categories', { title: 'Categories' })
})
}))
module.exports = router