rocket-include-static-resources 0.1.0

This is a crate which provides macros `static_resources_initialize!` and `static_response!` to static include files from your Rust project and make them be the HTTP response sources quickly.
docs.rs failed to build rocket-include-static-resources-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rocket-include-static-resources-0.10.5

Include Static Resources for Rocket Framework

This is a crate which provides macros static_resources_initialize! and static_response! to static include files from your Rust project and make them be the HTTP response sources quickly.

Example

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

#[macro_use] extern crate lazy_static;

#[macro_use] extern crate rocket_include_static_resources;

extern crate rocket;
extern crate crc;
extern crate mime_guess;

static_resources_initialize!(
   "favicon", "included-static-resources/favicon.ico",
   "favicon-png", "included-static-resources/favicon-16.png"
);

use rocket::response::Response;

#[get("/favicon.ico")]
fn favicon() -> Response<'static> {
   static_response!("favicon")
}

#[get("/favicon.png")]
fn favicon_png() -> Response<'static> {
   static_response!("favicon-png")
}

License

MIT