Skip to content

f/restafarian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Restafarian

Node.js Restful Client in ES6

Installation

npm install restafarian --save

Proposal

import {Client} from 'restafarian';

const {get, post, request} = new Client('http://api.example.com/v1');

class Users {

  @get('/users')
  getUsers(data) {
    return request(data);
  }
  
  @get('/users/:id')
  getUser(data) {
    // {url: "users/1", data: {name: "fatih"}}
    return request(data);
  }
  
  @post('/users')
  createUser(data) {
    return request(data);
  }
}

var users = new Users();
var user = users.getUser({id: 1, name: "fatih"}).then(() => {});

About

Node.js Restful Client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published