Skip to content

Instantly share code, notes, and snippets.

@youpy
Created June 16, 2012 16:29
Show Gist options
  • Save youpy/2941867 to your computer and use it in GitHub Desktop.
Save youpy/2941867 to your computer and use it in GitHub Desktop.
_.extend(Function.prototype, {
toRequestSpec: function(method, path, options) {
var self = this;
return function(done) {
request(
_.extend({
method: method,
url: 'http://localhost:' + port + path
}, options || {}),
function(req, res) {
self.call(null, req, res, done);
}
);
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment