Skip to content

TomazJunior/node-webhook

Repository files navigation

node-webhook JavaScript Style Guide Coverage Status

A simple webhook service, which will send a HTTP request based on the webhook's body and also store its result in mongodb.

Getting Started

With docker

docker-compose up

Without docker

Prerequisites

npm install
npm start

API examples

The node-webhook is usefull if you need to track and log HTTP requests.

  • GET /webhook Return all requests

  • GET /webhook/{id} Return a specific request

  • GET /about Return README.md content

  • POST /webhook Handle the webhook and returns the request id

    • e.g.:
    header: Content-Type = application/json
    body : {
      "port": 443,
      "protocol": "https:",
      "host": "github.com",
      "path": "/TomazJunior/node-webhook"
    }
    response : {
      "id": "5b4fa8cd822fce0fb1102ecf",
      "status": "pending"
    }
    

Running the tests

npm run test

It uses StandardJS, mocha, chai, sinon and nyc.

Author

See also the list of contributors who participated in this project.

Next steps

  • Implement unit tests
  • Dockerize it
  • Turn it into a node module

Keywords

  • Child Processes
  • Requests
  • MongoDB
  • Async/Await