Struct nickel::StaticFilesHandler [] [src]

pub struct StaticFilesHandler {
    // some fields omitted
}

Methods

impl StaticFilesHandler
[src]

fn new<P: AsRef<Path>>(root_path: P) -> StaticFilesHandler

Create a new middleware to serve files from within a given root directory. The file to serve will be determined by combining the requested Url with the provided root directory.

Examples

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

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

Trait Implementations

impl Clone for StaticFilesHandler
[src]

fn clone(&self) -> StaticFilesHandler

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<D> Middleware<D> for StaticFilesHandler
[src]

fn invoke<'a>(&self, req: &mut Request<D>, res: Response<'a, D>) -> MiddlewareResult<'a, D>