{"action":"created","issue":{"url":"https://api.github.com/repos/alubbe/named-routes/issues/7","labels_url":"https://api.github.com/repos/alubbe/named-routes/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/alubbe/named-routes/issues/7/comments","events_url":"https://api.github.com/repos/alubbe/named-routes/issues/7/events","html_url":"https://github.com/alubbe/named-routes/issues/7","id":97779306,"number":7,"title":"Express redirect","user":{"login":"hendore","id":1441228,"avatar_url":"https://avatars.githubusercontent.com/u/1441228?v=3","gravatar_id":"","url":"https://api.github.com/users/hendore","html_url":"https://github.com/hendore","followers_url":"https://api.github.com/users/hendore/followers","following_url":"https://api.github.com/users/hendore/following{/other_user}","gists_url":"https://api.github.com/users/hendore/gists{/gist_id}","starred_url":"https://api.github.com/users/hendore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hendore/subscriptions","organizations_url":"https://api.github.com/users/hendore/orgs","repos_url":"https://api.github.com/users/hendore/repos","events_url":"https://api.github.com/users/hendore/events{/privacy}","received_events_url":"https://api.github.com/users/hendore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-28T19:05:48Z","updated_at":"2015-07-29T11:51:59Z","closed_at":null,"body":"Is it possible to override the behaviour of the express response object that's injected into route handlers so that the redirect method can work with named routes?\r\n\r\n```js\r\nmodule.exports.logout = function (req, res) {\r\n    res.redirect('come-back-soon');\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/alubbe/named-routes/issues/comments/125929274","html_url":"https://github.com/alubbe/named-routes/issues/7#issuecomment-125929274","issue_url":"https://api.github.com/repos/alubbe/named-routes/issues/7","id":125929274,"user":{"login":"alubbe","id":2028065,"avatar_url":"https://avatars.githubusercontent.com/u/2028065?v=3","gravatar_id":"","url":"https://api.github.com/users/alubbe","html_url":"https://github.com/alubbe","followers_url":"https://api.github.com/users/alubbe/followers","following_url":"https://api.github.com/users/alubbe/following{/other_user}","gists_url":"https://api.github.com/users/alubbe/gists{/gist_id}","starred_url":"https://api.github.com/users/alubbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alubbe/subscriptions","organizations_url":"https://api.github.com/users/alubbe/orgs","repos_url":"https://api.github.com/users/alubbe/repos","events_url":"https://api.github.com/users/alubbe/events{/privacy}","received_events_url":"https://api.github.com/users/alubbe/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T11:51:59Z","updated_at":"2015-07-29T11:51:59Z","body":"Sure, in your middlewares, you can write\r\n```js\r\napp.use(function(req,res,next) {\r\n  var _redirect = res.redirect;\r\n  res.redirect = function(routeName, params) {\r\n    return _redirect.call(res, app.namedRoutes.build(routeName, params));\r\n  };\r\n});\r\n```"}}