mirror of
https://github.com/nvms/prsm.git
synced 2025-12-16 16:10:54 +00:00
README
This commit is contained in:
parent
e8d489bbfe
commit
fcab68acf6
@ -25,15 +25,16 @@ const ws = new KeepAliveServer({
|
|||||||
|
|
||||||
ws.registerCommand(
|
ws.registerCommand(
|
||||||
"authenticate",
|
"authenticate",
|
||||||
async (c: WSContext) => {
|
async (c: WSContext<{ token: string >}) => {
|
||||||
|
const { token } = c.payload;
|
||||||
// use c.payload to authenticate c.connection
|
// use c.payload to authenticate c.connection
|
||||||
return { ok: true, token: "..." };
|
return { ok: true, token };
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
ws.registerCommand(
|
ws.registerCommand(
|
||||||
"throws",
|
"throws",
|
||||||
async (c: WSContext) => {
|
async (c: WSContext<unknown>) => {
|
||||||
throw new Error("oops");
|
throw new Error("oops");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user