From f2a764d84e033b9b445a166e406f2e814d9651ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 20 May 2023 18:22:24 +0200 Subject: [PATCH] fix: proper error message when web ui not enabled --- cli/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 14b5fc8..6133fc5 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -432,11 +432,14 @@ fn main() -> Result<()> { actix_files::Files::new("/", ui_path).index_file("index.html"), ); } - } else { - // TODO - 503 error } - app + #[actix_web::get("/")] + async fn unavailable_index() -> actix_web::HttpResponse { + actix_web::HttpResponse::ServiceUnavailable().body("Web UI not enabled.") + } + + return app.service(unavailable_index); }); let bind_result = server.bind(&bind);