make serve work

This commit is contained in:
Sebastian Hugentobler 2023-03-14 12:42:54 +01:00
parent 339f9626d2
commit 14ab9bf469
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
3 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,8 @@ check:
cargo deny check cargo deny check
serve: wasm serve: wasm
cargo run --package woweb cd woweb; \
cargo run
release: $(DIST_DIR) wasm release: $(DIST_DIR) wasm
cargo build --package woweb --release cargo build --package woweb --release

View File

@ -1,13 +1,13 @@
use axum::routing::get; use axum::routing::get;
use axum::Router; use axum::Router;
use axum_extra::routing::SpaRouter; use axum_extra::routing::SpaRouter;
use dist_text::text::Text;
use std::env; use std::env;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::sync::Arc; use std::sync::Arc;
use tokio::sync::{broadcast, RwLock}; use tokio::sync::{broadcast, RwLock};
use tower_http::trace::TraceLayer; use tower_http::trace::TraceLayer;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
use dist_text::text::Text;
mod ws; mod ws;

View File

@ -9,8 +9,8 @@ use axum::{
response::IntoResponse, response::IntoResponse,
}; };
use futures::{sink::SinkExt, stream::StreamExt};
use dist_text::crdts::list::Op; use dist_text::crdts::list::Op;
use futures::{sink::SinkExt, stream::StreamExt};
use crate::AppState; use crate::AppState;
@ -84,6 +84,5 @@ async fn handle_socket(stream: WebSocket, state: Arc<AppState>) {
tokio::select! { tokio::select! {
_ = (&mut send_task) => recv_task.abort(), _ = (&mut send_task) => recv_task.abort(),
_ = (&mut recv_task) => send_task.abort(), _ = (&mut recv_task) => send_task.abort(),
} };
;
} }