mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-21 17:00:50 -05:00
22 lines
545 B
Go
22 lines
545 B
Go
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
package wsapi
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost-server/model"
|
|
)
|
|
|
|
func (api *API) InitSystem() {
|
|
api.Router.Handle("ping", api.ApiWebSocketHandler(ping))
|
|
}
|
|
|
|
func ping(req *model.WebSocketRequest) (map[string]interface{}, *model.AppError) {
|
|
data := map[string]interface{}{}
|
|
data["text"] = "pong"
|
|
data["version"] = model.CurrentVersion
|
|
data["server_time"] = model.GetMillis()
|
|
data["node_id"] = ""
|
|
|
|
return data, nil
|
|
}
|