Skip to content

Latest commit

 

History

History

webhook

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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