2.1.0 • Published 6 years ago

actions-http v2.1.0

Weekly downloads
32
License
MIT
Repository
github
Last release
6 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

6 years ago

2.0.13

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.0

6 years ago