The Benzinga Webhook Receiver is a Go application designed to receive and process webhook requests. It features two primary endpoints:
/healthz
for health checks/log
for logging JSON data received via POST requests.
- Docker
- Go 1.17 (for local development and testing)
- Git (for version control)
Clone the repository:
git clone https://github.com/lamthaithanhlong/benzinga-webhook-receiver.git
cd benzinga-webhook-receiver
Build the Docker image using the following command:
docker build -t webhook-receiver .
Run the application using Docker:
docker run -p 8080:8080 webhook-receiver
This command starts the webhook receiver on port 8080.
To check the health of the application, use the following curl
command:
curl --location 'http://localhost:8080/healthz'
To post log data to the /log
endpoint:
curl --location 'http://localhost:8080/log' \
--header 'Content-Type: application/json' \
--data '{
"user_id": 1,
"total": 1.65,
"title": "delectus aut autem",
"meta": {
"logins": [
{
"time": "2020-08-08T01:52:50Z",
"ip": "0.0.0.0"
}
],
"phone_numbers": {
"home": "555-1212",
"mobile": "123-5555"
}
},
"completed": false
}'
You can test webhook integrations using the provided RequestBin URL:
https://webhook.site/f1eeaf82-8cc5-4a79-bcf7-00b6e530e65c
Send data to this endpoint to see how the application processes and forwards requests.
Run Golangci-lint to ensure the codebase adheres to linting standards:
golangci-lint run
Execute the following command to run tests recursively with verbose output:
ginkgo -r -v
I will implement this in near future lol!
Contributions to the Benzinga Webhook Receiver are welcome! Please refer to the contributing guidelines before making pull requests.
This project is licensed under the MIT License.