mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 16:49:58 -07:00
server: documentation part 1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use axum::{Router, response::Redirect, routing::get};
|
||||
use aide::axum::ApiRouter;
|
||||
use axum::{response::Html, routing::get};
|
||||
|
||||
use crate::api::{chain::ApiExplorerRoutes, metrics::ApiMetricsRoutes};
|
||||
|
||||
@@ -11,17 +12,10 @@ pub trait ApiRoutes {
|
||||
fn add_api_routes(self) -> Self;
|
||||
}
|
||||
|
||||
impl ApiRoutes for Router<AppState> {
|
||||
impl ApiRoutes for ApiRouter<AppState> {
|
||||
fn add_api_routes(self) -> Self {
|
||||
self.add_api_explorer_routes()
|
||||
.add_api_metrics_routes()
|
||||
.route(
|
||||
"/api",
|
||||
get(|| async {
|
||||
Redirect::temporary(
|
||||
"https://github.com/bitcoinresearchkit/brk/tree/main/crates/brk_server#api",
|
||||
)
|
||||
}),
|
||||
)
|
||||
.route("/api", get(Html::from(include_str!("./scalar.html"))))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user