Added a ping keepalive endpoint.
This commit is contained in:
@@ -39,6 +39,7 @@ func New(cfg *bridge.Config) bridge.Bridger {
|
||||
return key == b.GetString("Token"), nil
|
||||
}))
|
||||
}
|
||||
e.GET("/api/ping", b.handlePing)
|
||||
e.GET("/api/messages", b.handleMessages)
|
||||
e.GET("/api/stream", b.handleStream)
|
||||
e.POST("/api/message", b.handlePostMessage)
|
||||
@@ -75,6 +76,10 @@ func (b *Api) Send(msg config.Message) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (b *Api) handlePing(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "pong")
|
||||
}
|
||||
|
||||
func (b *Api) handlePostMessage(c echo.Context) error {
|
||||
message := config.Message{}
|
||||
if err := c.Bind(&message); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user