Move the websocket to /websocket/ws from /ws - part 1 of cleaning up the Axum Router tree.

This commit is contained in:
Herbert Wolverson 2024-07-03 08:41:17 -05:00
parent 32d821b3af
commit 8eaa9c6324
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ export function subscribeWS(channels, handler) {
ws.close(); ws.close();
} }
ws = new WebSocket('ws://' + window.location.host + '/ws'); ws = new WebSocket('ws://' + window.location.host + '/websocket/ws');
ws.onopen = () => { ws.onopen = () => {
for (let i=0; i<channels.length; i++) { for (let i=0; i<channels.length; i++) {
ws.send("{ \"channel\" : \"" + channels[i] + "\"}"); ws.send("{ \"channel\" : \"" + channels[i] + "\"}");

View File

@ -14,7 +14,7 @@ pub async fn spawn_webserver() -> Result<()> {
// Construct the router from parts // Construct the router from parts
let router = Router::new() let router = Router::new()
.nest("/", websocket_router()) .nest("/websocket/", websocket_router())
.nest("/vendor", vendor_route()?) // Serve /vendor as purely static .nest("/vendor", vendor_route()?) // Serve /vendor as purely static
.nest("/", static_routes()?) .nest("/", static_routes()?)
.nest("/local-api", local_api()); .nest("/local-api", local_api());