From 91bf26fd8b1a7a46497be7c6bb942ec8a5b80f0d Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 18 May 2026 12:34:00 +0800 Subject: [PATCH] fix: /doc redirects to /doc-wasm (remove old Python doc login) --- src/api/server.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/server.rs b/src/api/server.rs index 49399e9..d1b0783 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -3447,6 +3447,10 @@ async fn unregister( } /// Serve documentation HTML pages with cookie-based auth. +async fn doc_redirect() -> axum::response::Redirect { + axum::response::Redirect::to("/doc-wasm") +} + async fn wasm_doc_handler() -> Result { let path = std::path::Path::new("/Users/accusys/momentry_core_0.1/docs_v1.0/doc_wasm/index.html"); match tokio::fs::read_to_string(path).await { @@ -3704,9 +3708,9 @@ pub async fn start_server(host: &str, port: u16) -> anyhow::Result<()> { let app = Router::new() .route("/health", get(health)) - .route("/doc", get(doc_handler)) - .route("/doc/*file", get(doc_file_handler)) - .route("/dev-doc", get(dev_doc_handler)) + .route("/doc", get(doc_redirect)) + .route("/doc/*file", get(doc_redirect)) + .route("/dev-doc", get(doc_redirect)) .route("/doc-wasm", get(wasm_doc_handler)) .route("/doc-wasm/*file", get(wasm_doc_file_handler)) .route("/api/v1/auth/login", post(login))