Added infrastructure for basic WebSocket API (#3432)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
06eacf30b9
Коммит
ad343a0f4a
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user