Skip to content

Instantly share code, notes, and snippets.

@nlf
Created April 3, 2014 17:15
Show Gist options
  • Save nlf/9958705 to your computer and use it in GitHub Desktop.
Save nlf/9958705 to your computer and use it in GitHub Desktop.
server.route({
method: 'get',
path: '/some/proxy',
handler: function (request, reply) {
request.query.something = 'whatever_static_value';
reply.proxy({
uri: 'http://some.upstream',
onResponse: function (err, res, request, reply, settings, ttl) {
Nipple.read(res, function (err, body) {
// do something with res
reply(res);
})
}
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment