Skip to content

Instantly share code, notes, and snippets.

@phated
Created September 22, 2015 21:46
Show Gist options
  • Select an option

  • Save phated/03cc54cc4022df2693ea to your computer and use it in GitHub Desktop.

Select an option

Save phated/03cc54cc4022df2693ea to your computer and use it in GitHub Desktop.
pathprefix
var rest = require('rest');
var pathPrefix = require('rest/interceptor/pathPrefix');
var client = rest.wrap(pathPrefix, { prefix: 'http://example.com/' });
// will request from `http://example.com//something`
client({ path: '/something' }).then(console.log.bind(console));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment