fix: /doc redirects to /doc-wasm (remove old Python doc login)
This commit is contained in:
@@ -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<impl axum::response::IntoResponse, (StatusCode, &'static str)> {
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user