Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Redirect-support #15

Closed
wants to merge 1 commit into from

2 participants

@kesla

Add bounce.redirect to redirect (302) to another url.

@substack substack closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 2, 2011
  1. @kesla

    add bounce.redirect

    kesla authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 index.js
View
7 index.js
@@ -103,5 +103,12 @@ function makeBounce (bs, client, req) {
return res;
};
+ bounce.redirect = function (to) {
+ var res = bounce.respond();
+ res.statusCode = 302;
+ res.setHeader('Location', to);
+ res.end('Redirecting to <a href="' + to + '">' + to + '</a>');
+ };
+
return bounce;
}
Something went wrong with that request. Please try again.