slash-files-rs 0.1.0

Configurable Rust file browser with HTMX UI, JSON API, previews, batch operations, and multi-framework adapters.
Documentation

slash-files-rs

slash-files-rs is an embeddable file browser for Rust web applications.

It gives you a polished HTMX frontend, a JSON API, multi-mount support, previews, batch operations, and framework adapters so you can mount a browser at a configurable route and point it at one or more server directories.

Features

  • configurable mount path and branding
  • multiple named mounts with availability reporting
  • directory browsing, sorting, and flattened filename search
  • file previews for common browser-supported types
  • custom preview hooks for application-specific file types
  • raw downloads, archive downloads, batch delete, and cross-mount transfer
  • JSON API mirroring the main mounted behavior
  • feature-gated adapters for Axum, Actix-web, and Poem

Crate features

  • axum
  • actix-web
  • poem

Enable only the adapter feature(s) you need.

Quick start

Axum

Cargo.toml

[dependencies]
slash-files-rs = { version = "0.1.0", features = ["axum"] }

main.rs

use axum::Router;
use slash_files::{AxumFileServer, FileServerConfig};

let file_server = AxumFileServer::new(
    FileServerConfig::new("./data").with_mount_path("/files"),
);

let app = Router::new().merge(file_server.router());

Actix-web

Cargo.toml

[dependencies]
slash-files-rs = { version = "0.1.0", features = ["actix-web"] }

main.rs

use actix_web::{App, HttpServer};
use slash_files::{ActixFileServer, FileServerConfig};

let file_server = ActixFileServer::new(
    FileServerConfig::new("./data").with_mount_path("/files"),
);

HttpServer::new(move || App::new().service(file_server.clone().scope()));

Poem

Cargo.toml

[dependencies]
slash-files-rs = { version = "0.1.0", features = ["poem"] }

main.rs

use slash_files::{FileServerConfig, PoemFileServer};

let file_server = PoemFileServer::new(
    FileServerConfig::new("./data").with_mount_path("/files"),
);

let app = file_server.route();

Docs

  • JSON API: docs/json-api.md
  • Framework support: docs/framework-support.md