bee-hook
is a simple, zero-configuration command-line hook server. It's powerful enough for production usage, but also simple and hackable enough to be used for testing, local development and learning. (inspired by http-server)
npm install bee-hook -g
bee-hook [options]
Now you can visit http://localhost:5000 to view your server
-p
Port to use (defaults to 5000)
URL : /api/bins
Method : POST
Reponses
Code : 200 OK
Content :
{
"hash": "<hash>",
"url": "http://localhost:5000/bin/<hash>"
}
URL : /bin/<hash>
Method : { POST | GET | PUT | PATCH | DELETE | OPTIONS }
Body :
{
"name": "Lucas Daiki",
"Age": "23"
}
Reponses
Code : 200 OK
Content : { "id": "<id>" }
URL : /api/bins/<hash>
Method : GET
Reponses
Code : 200 OK
Content :
{
"created_at": "2018-02-19T21:56:47.942Z",
"last_update": "2018-02-19T22:02:40.149Z",
"bins": [
{
"id": "1s41xgf",
"method": "POST",
"body": {
"name": "Lucas Daiki",
"Age": "23"
},
"query": {},
"headers": { ... },
"created_at": "2018-02-19T22:01:17.784Z"
},
{
"id": "10xjh47",
"method": "GET",
"body": { },
"query": { "test": "123" }, // ?test=123
"headers": { ... },
"created_at": "2018-02-19T22:02:40.149Z"
}
],
"total": 2
}
URL : /api/bins/<hash>/<id>
Method : GET
Reponses
Code : 200 OK
Content :
{
"id": "1s41xgf",
"method": "POST",
"body": {
"name": "Lucas Daiki",
"Age": "23"
},
"query": {},
"headers": { ... },
"created_at": "2018-02-19T22:01:17.784Z"
}
URL : /api/bins
Method : GET
Reponses
Code : 200 OK
Content :
[
{
"hash":"grqjbf8bti",
"created_at":"2018-02-21T23:24:05.488Z",
"last_update":"2018-02-21T23:26:00.595Z",
"total":50
},
{
"hash":"hhyasd12x",
"created_at":"2018-02-21T23:24:05.488Z",
"last_update":"2018-02-23T23:26:00.595Z",
"total":6
}
]
URL : /api/bins/<hash>
Method : DELETE
Reponses
Code : 200 OK
Content : No Content
-
Clone the
bee-hook
repository -
Install heroku See more
-
Login Heroku
heroku login
- Create an app on Heroku
heroku create
- Deploy your hook server :D
git push heroku master
- Open the new url
heroku open
- Configuring self url
$ heroku apps:info hook-mock
...
# Web URL: <url>
$ heroku config:set HOST=<url>
- Clone the
bee-hook
repository - Add your server key as deployment key in repository
- Edit
ecosystem.conf.js
- Setup application on server - run this in your machine -
pm2 deploy production setup
- Deploy application - run this in your machine -
pm2 deploy production --force