From ad343a0f4ad175053f7d0da12a0587bcbb396d1c Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 12 Jul 2016 09:36:27 -0400 Subject: Added infrastructure for basic WebSocket API (#3432) --- api/general.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api/general.go') diff --git a/api/general.go b/api/general.go index fdf884d6b..4124d2e95 100644 --- a/api/general.go +++ b/api/general.go @@ -21,6 +21,7 @@ func InitGeneral() { BaseRoutes.General.Handle("/log_client", ApiAppHandler(logClient)).Methods("POST") BaseRoutes.General.Handle("/ping", ApiAppHandler(ping)).Methods("GET") + BaseRoutes.WebSocket.Handle("ping", ApiWebSocketHandler(webSocketPing)) } func getClientConfig(c *Context, w http.ResponseWriter, r *http.Request) { @@ -71,3 +72,8 @@ func ping(c *Context, w http.ResponseWriter, r *http.Request) { m["node_id"] = "" w.Write([]byte(model.MapToJson(m))) } + +func webSocketPing(req *model.WebSocketRequest, responseData map[string]interface{}) *model.AppError { + responseData["text"] = "pong" + return nil +} -- cgit v1.2.3-1-g7c22