diff --git a/examples/web/rust/src/main.rs b/examples/web/rust/src/main.rs index b02d422a7..37e0b58bf 100644 --- a/examples/web/rust/src/main.rs +++ b/examples/web/rust/src/main.rs @@ -23,6 +23,7 @@ use rustls::{DigitallySignedStruct, SignatureScheme}; use tokio::sync::{Notify, RwLock}; use tokio::task::JoinSet; use tokio::{select, signal}; +use tower_http::services::ServeDir; use tower_http::trace::TraceLayer; use tracing::{debug, error, info, instrument, trace, warn}; use tracing_subscriber::layer::SubscriberExt as _; @@ -691,6 +692,11 @@ export const PORT = "{port}" ), )), ) + // Serve the `@bytecodealliance/wrpc` codec the UI imports. + .nest_service( + "/wrpc", + ServeDir::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../../../js/src")), + ) .fallback(index) .layer(TraceLayer::new_for_http()), ); diff --git a/examples/web/ui/index.html b/examples/web/ui/index.html index 8cf5f7d09..67d568432 100644 --- a/examples/web/ui/index.html +++ b/examples/web/ui/index.html @@ -32,12 +32,65 @@ }