echo
This commit is contained in:
parent
10a72d3e4b
commit
de67f31ba3
1 changed files with 3 additions and 1 deletions
|
@ -58,10 +58,12 @@ pub async fn websocket(stream: WebSocket, state: Arc<AppState>) {
|
|||
match message {
|
||||
Message::Text(text) => {
|
||||
tracing::debug!("Text: {}", text);
|
||||
|
||||
if let Ok(new_game) = serde_json::from_str::<NewGameRequest>(&text) {
|
||||
tracing::debug!("{:#?}", new_game);
|
||||
} else {
|
||||
tracing::debug!("Not JSON!");
|
||||
// just echo
|
||||
let _res = sender.send(Message::Text(text)).await;
|
||||
}
|
||||
}
|
||||
Message::Binary(data) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue