resource.js
v1.0.2
Published
Get yo' food on, yo'
Downloads
5
Readme
Resource.js
Create HTTP API clients with ease
Usage:
var $ = require('jquery');
var resource = requrie('resource')({
// Must provide your own http interface
http: $.ajax
});
// Setup your api
var api = resource('http:/localhost:3000/api');
api.users = api('users');
api.books = api('books');
api.users.get(123, function( error, user ){
});
var bob = api.users(123);
bob.put( { interest: ['Having fun'] }, function( error, user ){
});
Install:
bower install resource
npm install resource