Answer the question
In order to leave comments, you need to log in
How to make a redirect in the handler router.delete(...)?
Hey!
The code:
router.delete('/api/users/:id', function*() {
yield this.userById.remove();
this.redirect('/api/users');
this.body = 'Ok';
});
--> DELETE /api/users/57ecc74b201259000f29165d 302 32ms 2b
<-- DELETE /api/users
--> DELETE /api/users 404 5ms -
router.get('/api/users', ...);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question