Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emanchado/099c851f98b41480b005d68e29237ca9 to your computer and use it in GitHub Desktop.
Save emanchado/099c851f98b41480b005d68e29237ca9 to your computer and use it in GitHub Desktop.
var heads = require("robohydra").heads,
RoboHydraHead = heads.RoboHydraHead,
RoboHydraHeadProxy = heads.RoboHydraHeadProxy;
module.exports.getBodyParts = function() {
return {
heads: [
new RoboHydraHead({
path: '/',
handler: function(req, res, next) {
console.log("req.headers =", JSON.stringify(req.headers, null, 2));
next(req, res);
}
}),
new RoboHydraHeadProxy({
mountPath: '/',
proxyTo: 'http://demiurgo.org'
})
]
};
};
{"plugins": ["no-caching", "proxyexample"],
"useRawHeaders": true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment