github.com/vnforks/kid@v5.11.1+incompatible/wsapi/system.go (about) 1 // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package wsapi 5 6 import ( 7 "github.com/mattermost/mattermost-server/model" 8 ) 9 10 func (api *API) InitSystem() { 11 api.Router.Handle("ping", api.ApiWebSocketHandler(ping)) 12 } 13 14 func ping(req *model.WebSocketRequest) (map[string]interface{}, *model.AppError) { 15 data := map[string]interface{}{} 16 data["text"] = "pong" 17 data["version"] = model.CurrentVersion 18 data["server_time"] = model.GetMillis() 19 data["node_id"] = "" 20 21 return data, nil 22 }