chore: kanban template
This commit is contained in:
28
packages/functions/src/wirings/cards.channel.ts
Normal file
28
packages/functions/src/wirings/cards.channel.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { wireChannel } from '#pikku'
|
||||
import {
|
||||
onCardsConnect,
|
||||
onCardsDisconnect,
|
||||
onCardsEcho,
|
||||
onCardsSetSession,
|
||||
onCardsGetSession,
|
||||
onCardsClearSession,
|
||||
} from '../functions/cards-channel.function.js'
|
||||
|
||||
wireChannel({
|
||||
name: 'cards',
|
||||
route: '/cards/live',
|
||||
auth: false,
|
||||
onConnect: onCardsConnect,
|
||||
onDisconnect: onCardsDisconnect,
|
||||
// Route messages by `action` so pikku JSON-parses the frame + dispatches
|
||||
// to the right handler. Frames look like `{action:'echo', text:'…'}`.
|
||||
onMessageWiring: {
|
||||
action: {
|
||||
echo: { func: onCardsEcho },
|
||||
setSession: { func: onCardsSetSession },
|
||||
getSession: { func: onCardsGetSession },
|
||||
clearSession: { func: onCardsClearSession },
|
||||
},
|
||||
},
|
||||
tags: ['kanban'],
|
||||
})
|
||||
Reference in New Issue
Block a user