Struct nickel::StaticFilesHandler
[−]
[src]
pub struct StaticFilesHandler { /* fields omitted */ }
Methods
impl StaticFilesHandler
[src]
fn new<P: AsRef<Path>>(root_path: P) -> StaticFilesHandler
[src]
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
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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>
[src]
&self,
req: &mut Request<D>,
res: Response<'a, D>
) -> MiddlewareResult<'a, D>