make serve work
This commit is contained in:
parent
339f9626d2
commit
14ab9bf469
3
Makefile
3
Makefile
@ -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
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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(),
|
||||||
}
|
};
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user