Webhook hosted by golang
git clone https://github.com/LucienShui/Webhook.git -b build --depth=1Usage of webhook:
-c string
-c <config file> (default "./config.json")
-version
Print version information
For example, config.json looks like below:
{
"address": "0.0.0.0",
"port": 10086,
"webhooks": [
{
"name": "beat",
"script": "echo 'It works!'",
"password": ""
},
{
"name": "hello",
"script": "set -x && echo 'Hello World!'",
"password": "world"
}
]
}One can access the API /:name?password= to execute the script
POST /:name?password=[password]
| Name | Type | Description |
|---|---|---|
| name | string | record's name |
| password | string | record's password |
curl -X POST <host>:[port]/hello?password=wordGET /log/:name?raw=true
| Name | Type | Description |
|---|---|---|
| name | string | record's name |
| raw | bool | show execute's output in raw or not, false for default |
curl <host>:[port]/log/hello?raw=true
curl <host>:[port]/log/hello