Struct nickel::StaticFilesHandler [] [src]

pub struct StaticFilesHandler {
    // some fields omitted
}

Methods

impl StaticFilesHandler

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 Middleware for StaticFilesHandler

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

Derived Implementations

impl Clone for StaticFilesHandler

fn clone(&self) -> StaticFilesHandler

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