diff options
author | Patrick Connolly <patrick.c.connolly@gmail.com> | 2018-11-07 16:11:59 +0800 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-07 09:11:59 +0100 |
commit | 5666821e7bc02d5b3b5afb21355be911ff32bfbc (patch) | |
tree | e396040696ae7379919724c7c3b78a9b7e93b9a0 /bridge/api/api.go | |
parent | 5132d8f097a7eef2cb3d43c1c4cd297bc8254df5 (diff) | |
download | matterbridge-msglm-5666821e7bc02d5b3b5afb21355be911ff32bfbc.tar.gz matterbridge-msglm-5666821e7bc02d5b3b5afb21355be911ff32bfbc.tar.bz2 matterbridge-msglm-5666821e7bc02d5b3b5afb21355be911ff32bfbc.zip |
Add a health endpoint to API (#554)
Diffstat (limited to 'bridge/api/api.go')
-rw-r--r-- | bridge/api/api.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/api/api.go b/bridge/api/api.go index 1efe7558..da1f91e2 100644 --- a/bridge/api/api.go +++ b/bridge/api/api.go @@ -41,6 +41,7 @@ func New(cfg *bridge.Config) bridge.Bridger { return key == b.GetString("Token"), nil })) } + e.GET("/api/health", b.handleHealthcheck) e.GET("/api/messages", b.handleMessages) e.GET("/api/stream", b.handleStream) e.POST("/api/message", b.handlePostMessage) @@ -77,6 +78,10 @@ func (b *Api) Send(msg config.Message) (string, error) { return "", nil } +func (b *Api) handleHealthcheck(c echo.Context) error { + return c.String(http.StatusOK, "OK") +} + func (b *Api) handlePostMessage(c echo.Context) error { message := config.Message{} if err := c.Bind(&message); err != nil { |