Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
http: Display simple info page on /
Merged did:key:z6Mkiksi...5Uef opened 1 year ago
1 file changed +8 -0 06fa429e 5444875e
modified radicle-httpd/src/lib.rs
@@ -15,6 +15,8 @@ use anyhow::Context as _;
use axum::body::{Body, HttpBody};
use axum::http::{Request, Response};
use axum::middleware;
+
use axum::response::IntoResponse;
+
use axum::routing::get;
use axum::Router;
use tokio::net::TcpListener;
use tower_http::trace::TraceLayer;
@@ -115,6 +117,7 @@ fn router(options: Options, profile: Profile) -> anyhow::Result<Router> {
    let raw_router = raw::router(profile);

    let app = Router::new()
+
        .route("/", get(root_index_handler))
        .merge(git_router)
        .nest("/api", api_router)
        .nest("/raw", raw_router);
@@ -122,6 +125,11 @@ fn router(options: Options, profile: Profile) -> anyhow::Result<Router> {
    Ok(app)
}

+
/// A simple response for people confused why their radicle-httpd displays only a blank page.
+
async fn root_index_handler() -> impl IntoResponse {
+
    "This is a radicle-httpd web server, intendent for API access. Use Radicle Explorer instance like https://app.radicle.xyz/ to interact with it."
+
}
+

pub mod logger {
    use tracing::dispatcher::Dispatch;