http-file

Crates.iohttp-file
lib.rshttp-file
version0.1.0
sourcesrc
created_at2023-12-29 03:14:20.10706
updated_at2023-12-29 03:14:20.10706
descriptionfile serving for http crate type
homepage
repositoryhttps://github.com/HFQR/xitca-web
max_upload_size
id1082934
size30,155
(fakeshadow)

documentation

README

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

  • nightly Rust
  • http and futures for http types and async streaming interaction1

Footnotes

  1. see project Cargo.toml for dependency versioning.

Commit count: 1266

cargo fmt