From f31241b967c02395b9ece2512c22b04eb1a0173d Mon Sep 17 00:00:00 2001 From: HOKMA-TECH Date: Thu, 6 Aug 2026 11:05:30 -0300 Subject: [PATCH] feat(server): pagina HTML na raiz --- server/src/api/mod.rs | 51 +++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/server/src/api/mod.rs b/server/src/api/mod.rs index da5c4d1..50cfc8a 100644 --- a/server/src/api/mod.rs +++ b/server/src/api/mod.rs @@ -7,23 +7,46 @@ pub mod stats; pub mod ws; use axum::{routing::{get, post}, Json, Router}; +use axum::response::Html; use tower_http::cors::CorsLayer; use crate::state::SharedState; -async fn index() -> Json { - Json(serde_json::json!({ - "service": "ares-next", - "version": env!("CARGO_PKG_VERSION"), - "endpoints": [ - "GET /api/v1/health", - "GET /api/v1/search?q=...", - "GET /api/v1/files/{file_id}", - "POST /api/v1/announce", - "GET /api/v1/peers/{file_id}", - "GET /api/v1/stats", - "WS /api/v1/tracker/ws" - ] - })) +async fn index() -> Html<&'static str> { + Html(r#" + + + + +Ares Next + + + +
+

Ares Next

+ online +

Tracker P2P + busca de arquivos por hash — API pública

+
    +
  • GET /api/v1/health
  • +
  • GET /api/v1/search?q=...
  • +
  • GET /api/v1/files/{file_id}
  • +
  • POST /api/v1/announce
  • +
  • GET /api/v1/peers/{file_id}
  • +
  • GET /api/v1/stats
  • +
  • WS /api/v1/tracker/ws
  • +
+
+ +"#) } pub fn router(state: SharedState) -> Router {