iron-send-file

Crates.ioiron-send-file
lib.rsiron-send-file
version0.1.1
sourcesrc
created_at2016-10-02 21:42:19.499923
updated_at2016-10-02 22:00:51.212081
descriptionServe files with Range header support for Iron library.
homepage
repositoryhttps://github.com/bancek/iron-send-file.git
max_upload_size
id6693
size5,544
Luka Zakrajšek (bancek)

documentation

https://docs.rs/iron-send-file/0.1.1/iron_send_file/

README

iron-send-file

Serve files with Range header support for Iron library.

Example

extern crate iron;
extern crate iron_send_file;

use std::path::Path;
use iron::prelude::*;
use iron_send_file::send_file;

fn main() {
    Iron::new(|req: &mut Request| {
            let path = Path::new("src/main.rs");

            let res = Response::new();

            send_file(req, res, path)
        })
        .http("localhost:3000")
        .unwrap();
}
$ curl http://localhost:3000 -H "Range: bytes=0-5"
extern

Author

Luka Zakrajšek

License

MIT

Commit count: 4

cargo fmt