Answer the question
In order to leave comments, you need to log in
How to make a redirect to koa.js after a POST request?
Using koa-router I make a route:
router.post('/registration', function* (next) {
var ctx = this;
models.users.create({
email: this.request.body.email
}).then(function() {
ctx.redirect('/');
});
})
Error: Can't set headers after they are sent.
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