mini-webhook-server

1.0.4 • Public • Published

Mini Webhook Server

A small, dependency free, single route webhook server

  • Supports POST bodies
  • JSON by default (we'll encode responses for you)
  • ES8
  • No callbacks - routes return an object with 'status' and 'body'
  • Automatic '200 OK' HTTP response when new jobs sent
  • Automatic sends reply HTTP request when your job is complete

Usage

const valueFunction = require('./value-function.js'),
  miniWebhookServer = require('mini-webhook-server')

const port = 4000,
    host = '127.0.0.1'

;(async function() {
  await miniWebhookServer(port, host, valueFunction)
})();

Then send a POST request, to /, with the parameters:

  • 'arguments' Array - to be passed onto the function being run
  • 'replyAddress' String - the URL to send replies to.

Package Sidebar

Install

npm i mini-webhook-server

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

2.89 kB

Total Files

3

Last publish

Collaborators

  • mikemaccana