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

#445 in HTTP server

Download history 31/week @ 2024-07-30 23/week @ 2024-09-24 12/week @ 2024-10-01

53 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–6.5MB
~46K SLoC