implement ping measure logic & endpoints

This commit is contained in:
SrGooglo 2023-03-07 02:13:04 +00:00
parent e195bf8cdf
commit 88e2931615
2 changed files with 11 additions and 0 deletions

View File

@ -216,6 +216,10 @@ export default class API {
})
}
this.server.websocket_instance.eventsChannels.push(["/main", "ping", async (socket) => {
return socket.emit("pong")
}])
this.server.websocket_instance.eventsChannels.push(["/main", "authenticate", async (socket, authPayload) => {
if (!authPayload) {
return onAuthenticatedFailed(socket, "missing_auth_payload")

View File

@ -0,0 +1,7 @@
export default {
route: "/ping",
method: "GET",
fn: async (req, res) => {
return res.send("pong")
}
}