mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-01-06 04:00:29 -05:00
wip
This commit is contained in:
parent
16058b92b3
commit
86f4ce2bd8
20
api/src/websockets.ts
Normal file
20
api/src/websockets.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import Elysia, { t } from "elysia";
|
||||
|
||||
const actionMap: Record<string, ][> = [
|
||||
|
||||
]
|
||||
|
||||
export const appWs = new Elysia().ws("/ws", {
|
||||
body: t.Union([
|
||||
t.Object({
|
||||
action: t.Literal("ping"),
|
||||
}),
|
||||
t.Object({
|
||||
action: t.Literal("watch"),
|
||||
entry: t.String(),
|
||||
}),
|
||||
]),
|
||||
message(ws, { message }) {
|
||||
actionMap[message.action](message);
|
||||
},
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user