res.redirect() #36

Merged
merged 4 commits into from Jul 19, 2012

Projects

None yet

3 participants

@yawnt
Contributor
yawnt commented Jul 15, 2012

Fix for #34

I've added ResponseStream.prototype.redirect

Example:

/*
Syntax: res.redirect(url, [method]);
*/

router.get('/foo', function() {
  this.res.redirect('http://www.google.com');
}
router.get('/foo', function() {
  this.res.redirect('/bar', 301);
}

If you want, i can add a body for the redirect like Expresss does.. i haven't included it here because i don't really like the idea (but it's just my two cents)

Contributor

Me gusta. Anyone else?

Contributor

lgtm

@pksunkara pksunkara merged commit 7d5b565 into flatiron:master Jul 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment