11 releases (3 stable)

2.0.1 Nov 16, 2023
2.0.0-alpha.2 Sep 16, 2023
1.0.0 Aug 22, 2019
0.5.0 Apr 5, 2019
0.1.0 Mar 5, 2019
Download history 6/week @ 2023-08-14 6/week @ 2023-08-28 14/week @ 2023-09-04 73/week @ 2023-09-11 5/week @ 2023-09-18 3/week @ 2023-09-25 2/week @ 2023-10-02 3/week @ 2023-10-16 10/week @ 2023-10-23 18/week @ 2023-10-30 43/week @ 2023-11-13 28/week @ 2023-11-20 30/week @ 2023-11-27

101 downloads per month

Apache-2.0

61KB
1K SLoC

http-fs

Build Crates.io Documentation

Features

  • tokio - Enables tokio runtime integration. Enables rt.
  • hyper - Enables hyper integration. Enables http1 and server features.

lib.rs:

http-fs

Features

  • tokio - Enables tokio runtime integration. Enables rt.
  • hyper - Enables hyper integration. Enables http1 and server features.

Usage

use http_fs::config::{self, StaticFileConfig, DummyWorker};
use http_fs::{StaticFiles};

use std::path::Path;

pub struct DirectoryConfig;
impl StaticFileConfig for DirectoryConfig {
    type FileService = config::DefaultConfig;
    type DirService = config::DefaultConfig;

    fn handle_directory(&self, _path: &Path) -> bool {
        true
    }
}

fn main() {
    let static_files = StaticFiles::new(DummyWorker, DirectoryConfig);
}

Dependencies

~1–2.4MB
~44K SLoC