/
gramex.yaml
31 lines (29 loc) · 932 Bytes
/
gramex.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
url:
websockethandler/pingbot:
pattern: /$YAMLURL/pingbot
handler: WebSocketHandler
kwargs:
open: # When websocket is opened
function: pingbot.open # call open(handler) in pingbot.py
on_message: # When client sends a message
function: pingbot.on_message # call on_message(handler, msg) in pingbot.py
on_close: # When websocket is closed
function: pingbot.on_close # call on_close(handler) in pingbot.py
websockethandler/chat:
pattern: /$YAMLURL/chat
handler: WebSocketHandler
kwargs:
open:
function: websocketchat.open
on_message:
function: websocketchat.on_message
on_close:
function: websocketchat.on_close
websockethandler/messages:
pattern: /$YAMLURL/messages
handler: WebSocketHandler
kwargs:
open:
function: messages.open
on_message:
function: messages.on_message