Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 382 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 382 Bytes

Law Axios

Law adapter for exposing a REST service. Uses axios under the covers.

Usage

const PORT = 3000
const rest = require('law-axios')
const {expect} = require('chai')

const api = rest({
  json: true,
  domain: `http://0.0.0.0:${PORT}`,
})

api('GET /theanswer', {q: 'to life, the universe, and everything'})
  .then(theanswer => expect(theanswer).to.equal(42))