mount 0.0.9

Mounting middleware for Iron.
docs.rs failed to build mount-0.0.9
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: mount-0.4.0

mount Build Status

Mounting middleware for the Iron web framework.

Example

fn send_hello(req: &mut Request) -> IronResult<Response> {
    Ok(Response::with((status::Ok, "Hello!")))
}

fn intercept(req: &mut Request) -> IronResult<Response> {
    Ok(Response::with((status::Ok, "Blocked!")))
}

fn main() {
    let mut mount = Mount::new();
    mount.mount("/blocked/", intercept).mount("/", send_hello);

    Iron::new(mount).listen(Ipv4Addr(127, 0, 0, 1), 3000);
}

Overview

mount is a part of Iron's core bundle.

  • Mount a handler on a sub-path, hiding the old path from that handler.

Installation

If you're using Cargo to manage dependencies, just add mount to the toml:

[dependencies.mount]

git = "https://github.com/iron/mount.git"

Otherwise, cargo build, and the rlib will be in your target directory.

Documentation

Along with the online documentation, you can build a local copy with cargo doc.

Examples

Get Help

One of us (@reem, @zzmp, @theptrk, @mcreinhard) is usually on #iron on the mozilla irc. Come say hi and ask any questions you might have. We are also usually on #rust and #rust-webdev.