mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 08:39:59 -07:00
website: big snapshot + cleanup
This commit is contained in:
@@ -6,7 +6,7 @@ use aide::{
|
||||
};
|
||||
use axum::{
|
||||
Extension,
|
||||
http::HeaderMap,
|
||||
http::{HeaderMap, header},
|
||||
response::{Html, Redirect, Response},
|
||||
routing::get,
|
||||
};
|
||||
@@ -83,6 +83,9 @@ impl ApiRoutes for ApiRouter<AppState> {
|
||||
),
|
||||
)
|
||||
.route("/api", get(Html::from(include_str!("./scalar.html"))))
|
||||
.route("/scalar.js", get(|| async {
|
||||
([(header::CONTENT_TYPE, "application/javascript")], include_str!("./scalar.js"))
|
||||
}))
|
||||
.route(
|
||||
"/api/{*path}",
|
||||
get(|| async { Redirect::permanent("/api") }),
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<!-- https://app.unpkg.com/@scalar/api-reference@1.37.0/files/dist/browser/standalone.js -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
||||
<script src="/scalar.js"></script>
|
||||
|
||||
<script>
|
||||
Scalar.createApiReference("#app", {
|
||||
url: "/openapi.json",
|
||||
hideClientButton: true,
|
||||
telemetry: false,
|
||||
withDefaultFonts: false,
|
||||
// showToolbar: "never",
|
||||
});
|
||||
</script>
|
||||
|
||||
8
crates/brk_server/src/api/scalar.js
Normal file
8
crates/brk_server/src/api/scalar.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user