0.4.0 • Published 7 years ago

service-factory v0.4.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

service-factory

Declarative HTTP client builder

Install

$ npm install --save service-factory

Usage

import ServiceFactory from "service-factory"

const declaration = {

  listUsers: {
    method: "GET",
    url: "/users"
  },

  findUser: {
    method: "GET",
    url: "/users/:id"
  },

  createUser: {
    method: "POST",
    url: "/users"
  }

}

const service = ServiceFactory.baseUrl("www.example.com").create(declaration)

const users = await service.listUsers()
0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago