tide-naive-static-files

A simple static file serving component for Rust's Tide web framework.

Acknowledgements

This code is based heavily on this archived example.

Example

```rust use tidenaivestaticfiles::{servestatic_file, StaticDirServer};

[async_std::main]

async fn main() { let mut app = tide::withstate(StaticDirServer::new("./public/").unwrap()); app.at("/*") .get(|req| async { servestatic_file(req).await.unwrap() }); app.listen("127.0.0.1:8000").await.unwrap(); } ```

Problems

Right now it does not use AsyncBufRead when putting data into the http::Response. This means it loads the file data into memory before sending it, so if you need to send gigantic files, that could be a problem. If you know of a solution, please open an issue on the repository!