#file-serving #http #file

http-file

file serving for http crate type

4 releases (2 breaking)

Uses new Rust 2024

0.3.0 Apr 9, 2026
0.2.1 Dec 27, 2025
0.2.0 Mar 12, 2025
0.1.0 Dec 29, 2023

#5 in #file-serving

Download history 15/week @ 2026-01-13 1/week @ 2026-02-03 10/week @ 2026-02-24 4/week @ 2026-03-03 3/week @ 2026-03-10 3/week @ 2026-03-17 35/week @ 2026-03-24 132/week @ 2026-03-31 84/week @ 2026-04-07 64/week @ 2026-04-14 34/week @ 2026-04-21 15/week @ 2026-04-28

217 downloads per month
Used in xitca-web

Apache-2.0

105KB
2K SLoC

an async static file serving crate

use http::Request;
use http_file::ServeDir;

async fn serve(req: &Request<()>) {
    let dir = ServeDir::new("sample");
    let res = dir.serve(&req).await;
}

Requirement

  • http
  • futures for http types and async streaming interaction

Dependencies

~2.4–5MB
~84K SLoC