Struct nickel::Mount [] [src]

pub struct Mount<M> { /* fields omitted */ }

Methods

impl<M> Mount<M>
[src]

[src]

Creates a new middleware that mounts a middleware at a mount point. An incoming request that matches the mount point will be forwareded to the mounted middleware, but with the path rewritten so that the mount point appears to be the root from the perspective of the mounted middleware. This can be useful in combination with the StaticFilesMiddleware, for example.

Examples

use nickel::{Nickel, StaticFilesHandler, Mount};
let mut server = Nickel::new();

server.utilize(
    Mount::new("/static_files/",
               StaticFilesHandler::new("/path/to/serve/")
));

Panics

Panics if mount_point does not have a leading and trailing slash.

Trait Implementations

impl<D, M: Middleware<D>> Middleware<D> for Mount<M>
[src]

[src]