mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
implement ping measure logic & endpoints
This commit is contained in:
parent
e195bf8cdf
commit
88e2931615
@ -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) => {
|
this.server.websocket_instance.eventsChannels.push(["/main", "authenticate", async (socket, authPayload) => {
|
||||||
if (!authPayload) {
|
if (!authPayload) {
|
||||||
return onAuthenticatedFailed(socket, "missing_auth_payload")
|
return onAuthenticatedFailed(socket, "missing_auth_payload")
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
export default {
|
||||||
|
route: "/ping",
|
||||||
|
method: "GET",
|
||||||
|
fn: async (req, res) => {
|
||||||
|
return res.send("pong")
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user