Humor me on this one guys....
npm install global-rest
global.baseUrl = "http://some-rest-service.com";
require('global-rest');
`
##Installation:
npm install global-rest
##Usage: This library is built based on the assumption you are doing your api endpoints in a basic RESTful way i.e /resource, /resource/:id for all the HTTP verbs. Also it is dependent on how you name your functions, as long as the last word in the name of your function is the resource name you will be fine, something you probably already do
WARNING: WILL NOT WORK IN STRICT MODE....yet
`//GET: "http://some-rest-service.com/users"`
`//pass in a optional 'id' param to make a call for one user`
`
function getUsers(){
$get() //return a thenable promise
}
`
`//PUT: "http://some-rest-service.com/profile/:id"`
`
function updateUserProfile(id,userData){
$put(id,userData); //return a thenable promise
}
`
`//DELETE: "http://some-rest-service.com/users/:id"`
`
function deleteUsers(id){
$delete(id); //return a thenable promise
}
`
`//POST: "http://some-rest-service.com/users/:id"`
`
function createUsers(id,user){
$post(id,user); //return a thenable promise
}
``