☰
Debian Codegraph
@
2.24.0-1
/
/
docs
/
examples
/
websockets
/
sending_json_dict.py
☽
☼
docs/examples/websockets/sending_json_dict.py
code
plain
raw
Expat
Alc <
[email protected]
>,; Cody Fincher <
[email protected]
>,; Jacob Coffee <
[email protected]
>,; Janek Nouvertné <
[email protected]
>,; Litestar Developers <
[email protected]
>,; Peter Schutt <
[email protected]
>,; Visakh Unnikrishnan <
[email protected]
>,
debian/copyright
1
from typing import Dict
2
3
from litestar import Litestar, websocket_listener
4
5
6
@websocket_listener("/")
7
async def handler(data: str) -> Dict[str, str]:
8
return {"message": data}
9
10
11
app = Litestar([handler])