Skip to content

Commit

Permalink
Update pathing for WS at root
Browse files Browse the repository at this point in the history
  • Loading branch information
alnoki committed Sep 1, 2024
1 parent c7cc99e commit a6ce851
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rust/broker/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ fn prepare_app(app: Router<Arc<AppState>>) -> Router<Arc<AppState>> {

#[cfg(all(feature = "ws", not(feature = "sse")))]
fn prepare_app(app: Router<Arc<AppState>>) -> Router<Arc<AppState>> {
app.route("/ws", get(ws::handler))
app.route("/", get(ws::handler))
}

#[cfg(all(feature = "ws", feature = "sse"))]
fn prepare_app(app: Router<Arc<AppState>>) -> Router<Arc<AppState>> {
app.route("/ws", get(ws::handler))
app.route("/", get(ws::handler))
.route("/sse", get(sse::handler))
}

Expand All @@ -39,7 +39,7 @@ fn prepare_app(app: Router<Arc<AppState>>) -> Router<Arc<AppState>> {
app
}

async fn root() {}
async fn live() {}

async fn health(State(state): State<Arc<AppState>>) -> StatusCode {
match *state.processor_connection_health.read().await {
Expand All @@ -60,7 +60,7 @@ pub async fn server(

let app = prepare_app(
Router::new()
.route("/", get(root))
.route("/live", get(live))
.route("/health", get(health)),
);
let app = app.with_state(Arc::new(app_state));
Expand Down

0 comments on commit a6ce851

Please sign in to comment.