Skip to content

Instantly share code, notes, and snippets.

@jrf0110
Created April 8, 2015 17:10
Show Gist options
  • Save jrf0110/7dfc17ee56c089d80524 to your computer and use it in GitHub Desktop.
Save jrf0110/7dfc17ee56c089d80524 to your computer and use it in GitHub Desktop.
var resource = require('resource', {
http: $.ajax
})('http://localhost:3000')
var api = resource('api')
var users = api('users')
var bob = users(123)
users.get( 123, function( error, bob ){
/* ... */
})
bob.put( { name: 'Bill' }, function( error, result ){
/* ... */
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment