fix: proper error message when web ui not enabled

feat/type-attributes
Tomáš Mládek 2023-05-20 18:22:24 +02:00
parent 5b96a9409c
commit f2a764d84e
1 changed files with 6 additions and 3 deletions

View File

@ -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);