Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 591 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 591 Bytes

Webhook Example in Go

The client will push a random event message to a webhook endpoint on the sever every 5 seconds.

Setup

  1. Run the server

    $ go run model.go server.go
  2. On another shell, run the client:

    $ go run model.go client.go

    Or use curl to call the webhook.

    $ curl -X POST \
        http://localhost:8000/webhook \
        -H 'Content-Type: application/json; charset=UTF-8' \
        -d '{"event": "create"}'
  3. Alternatively, you can run everything with just 1 command.

    $ make run