add handler for the route to be used as a healtcheck endpoint, fixes #233
This commit is contained in:
parent
5803d5e849
commit
f76426e9b0
@ -426,7 +426,7 @@ type Hook struct {
|
|||||||
JSONStringParameters []Argument `json:"parse-parameters-as-json,omitempty"`
|
JSONStringParameters []Argument `json:"parse-parameters-as-json,omitempty"`
|
||||||
TriggerRule *Rules `json:"trigger-rule,omitempty"`
|
TriggerRule *Rules `json:"trigger-rule,omitempty"`
|
||||||
TriggerRuleMismatchHttpResponseCode int `json:"trigger-rule-mismatch-http-response-code,omitempty"`
|
TriggerRuleMismatchHttpResponseCode int `json:"trigger-rule-mismatch-http-response-code,omitempty"`
|
||||||
IncomingPayloadContentType string `json:"incoming-payload-content-type,omitempty"`
|
IncomingPayloadContentType string `json:"incoming-payload-content-type,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseJSONParameters decodes specified arguments to JSON objects and replaces the
|
// ParseJSONParameters decodes specified arguments to JSON objects and replaces the
|
||||||
|
@ -185,6 +185,10 @@ func main() {
|
|||||||
hooksURL = "/" + *hooksURLPrefix + "/{id}"
|
hooksURL = "/" + *hooksURLPrefix + "/{id}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
router.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
fmt.Fprintf(w, "OK")
|
||||||
|
})
|
||||||
|
|
||||||
router.HandleFunc(hooksURL, hookHandler)
|
router.HandleFunc(hooksURL, hookHandler)
|
||||||
|
|
||||||
n.UseHandler(router)
|
n.UseHandler(router)
|
||||||
|
Loading…
Reference in New Issue
Block a user