This repository has been archived on 2023-07-05. You can view files and clone it, but cannot push or open issues or pull requests.
clessy/broker/webhook.go

18 lines
279 B
Go
Raw Normal View History

2016-02-08 16:52:13 +00:00
package main
import (
2016-02-09 10:01:05 +00:00
"io/ioutil"
2016-02-08 16:52:13 +00:00
"net/http"
)
func webhook(rw http.ResponseWriter, req *http.Request) {
2016-02-09 10:01:05 +00:00
// Read entire request and broadcast to everyone
data, err := ioutil.ReadAll(req.Body)
if err != nil {
return
}
2016-02-08 16:52:13 +00:00
defer req.Body.Close()
2016-02-09 10:01:05 +00:00
broadcast(string(data))
2016-02-08 16:52:13 +00:00
}