2.1.0 • Published 4 years ago

actions-http v2.1.0

Weekly downloads
32
License
MIT
Repository
github
Last release
4 years ago

actions-http

Provides a simple http interface with json parsing.

Interface

yarn add actions-http

Setup

Below is a simple use case of the client.

// your desired application interface.
const actions = {
  async ping(params) {
    return 'pong'
  },
  async echo(params) {
    return params
  }
}

const config = {
  port: 9001
}

// start the server
const web = require('actions-http')(config, actions)

Call

const request = require('request')

request.post('http://localhost:9001/echo', {
  // some json body
  test: true
})

request.get('http://localhost:9001/ping')
2.1.0

4 years ago

2.0.13

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.0

5 years ago