1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-24 10:23:28 +00:00

Start to implement WebSockets route system

This commit is contained in:
2020-03-31 14:42:53 +02:00
parent 92486a01ac
commit d4b624e519
3 changed files with 56 additions and 2 deletions

View File

@ -19,14 +19,14 @@ interface PendingRequests {
token: string
}
interface ActiveClient {
export interface ActiveClient {
socketID: string,
clientID: number,
userID: number,
ws: ws
}
interface WsMessage {
export interface WsMessage {
id: string,
title: string,
data: any

View File

@ -0,0 +1,17 @@
/**
* User Websocket requests route
*
* Note : this implementation requires the
* user to be signed in to perform requests
*
* @author Pierre Hubert
*/
import { UserWebSocketRequestsHandler } from "../entities/WebSocketRequestHandler";
export interface UserWebSocketRoute {
title: string,
handler: (h: UserWebSocketRequestsHandler) => Promise<void>
}
export const UserWebSocketRoutes: UserWebSocketRoute[] = []