test: middleware/error

This commit is contained in:
DIYgod
2019-01-29 19:15:06 +08:00
parent 8cec57eaec
commit d2fafd71db
2 changed files with 17 additions and 0 deletions

View File

@@ -87,6 +87,9 @@ router.get('/', async (ctx) => {
});
router.get('/test/:id', (ctx) => {
if (ctx.params.id === '0') {
throw Error('Error test');
}
const item = [];
for (let i = 1; i < 6; i++) {
item.push({