mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 11:15:41 +02:00
feat: add archive table web UI
This commit is contained in:
parent
ed68a53c0b
commit
47e6f0e53f
4 changed files with 615 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ use axum::{
|
|||
response::{IntoResponse, Response},
|
||||
routing::get,
|
||||
};
|
||||
use tower_http::services::{ServeDir, ServeFile};
|
||||
|
||||
use crate::registry::{MountedArchive, ServerRegistry};
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ pub fn app(registry: ServerRegistry) -> Router {
|
|||
let state = AppState {
|
||||
registry: Arc::new(registry),
|
||||
};
|
||||
let static_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("static");
|
||||
|
||||
Router::new()
|
||||
.route("/health", get(|| async { "ok" }))
|
||||
|
|
@ -30,6 +32,8 @@ pub fn app(registry: ServerRegistry) -> Router {
|
|||
get(entry_detail),
|
||||
)
|
||||
.route("/api/archives/:archive_id/runs", get(list_runs))
|
||||
.nest_service("/assets", ServeDir::new(&static_dir))
|
||||
.fallback_service(ServeFile::new(static_dir.join("index.html")))
|
||||
.with_state(state)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue