Struct nickel::StaticFilesHandler [] [src]

pub struct StaticFilesHandler {
    // some fields omitted


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.


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


Trait Implementations

impl Clone for StaticFilesHandler

fn clone(&self) -> StaticFilesHandler

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<D> Middleware<D> for StaticFilesHandler

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