https://github.com/tomazjunior/node-webhook
webHook node.js project
https://github.com/tomazjunior/node-webhook
child-process mongodb nodejs request webhook
Last synced: 6 months ago
JSON representation
webHook node.js project
- Host: GitHub
- URL: https://github.com/tomazjunior/node-webhook
- Owner: TomazJunior
- Created: 2018-07-18T20:09:53.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T21:30:10.000Z (over 3 years ago)
- Last Synced: 2025-02-13T23:12:49.287Z (over 1 year ago)
- Topics: child-process, mongodb, nodejs, request, webhook
- Language: JavaScript
- Homepage:
- Size: 233 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Audit: audit-resolv.json
Awesome Lists containing this project
README
# node-webhook [](https://github.com/feross/standard) [](https://coveralls.io/github/TomazJunior/node-webhook?branch=master)
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
- MongoDB https://docs.mongodb.com/manual/installation/
- NodeJS https://nodejs.org/en/
```
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
* **Tomaz Junior** - [github](https://github.com/TomazJunior)
See also the list of [contributors](https://github.com/TomazJunior/node-webhook/contributors) who participated in this project.
## Next steps
- [x] Implement unit tests
- [x] Dockerize it
- [ ] Turn it into a node module
## Keywords
- Child Processes
- Requests
- MongoDB
- Async/Await