diff --git a/src/main.rs b/src/main.rs index 76129b7..7398113 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,14 @@ async fn init(logger_initialized: &mut bool) -> Result<()> { .with_state(app_state) .nest_service("/static", static_service); - let app = Router::new().nest(&path_prefix, routes); + let app = { + if path_prefix == "/" { + // No need to nest. + routes + } else { + Router::new().nest(&path_prefix, routes) + } + }; info!("Starting server"); Server::bind(&socket_address)