On Mon, Jun 4, 2012 at 2:51 PM, Oliver Leics <oliver.le...@gmail.com> wrote: > express.use(function(req, res, next) { > if(req.headers.host === 'example.com') { > res.writeHead(303, {'Location': 'http://www.example.com'+req.url}) > res.end() > } > })
That made me learn a little about middleware, a new concept to me, and I really like it. In the end I implemented basically what you proposed, plus `next()` in the else clause. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en