Skip to content

maueki/embed_staticfile.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

embed_staticfile.rs

Usage

Add this to your Cargo.toml:

[dependencies]
include_dir_bytes = "0.2"
embed_staticfile = "0.2"

and use them like this:

#![feature(plugin)]
#![plugin(include_dir_bytes)]

extern crate iron;
extern crate mount;

extern crate embed_staticfile;

use iron::prelude::*;
use mount::Mount;
use embed_staticfile::EmbedStatic;

fn main() {
    let mut mount = Mount::new();
    mount.mount("/assets/", EmbedStatic::new(include_dir!("../assets")));

    Iron::new(mount).http("localhost:3000").unwrap();
}

About

Create embedded static file handler for Iron

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages