Struct actix_web::fs::StaticFiles
[−]
[src]
pub struct StaticFiles { /* fields omitted */ }
Static files handling
StaticFile
handler must be registered with Application::handler()
method,
because StaticFile
handler requires access sub-path information.
use actix_web::{fs, Application}; fn main() { let app = Application::new() .handler("/static", fs::StaticFiles::new(".", true)) .finish(); }
Methods
impl StaticFiles
[src]
fn new<D: Into<PathBuf>>(dir: D, index: bool) -> StaticFiles
[src]
Create new StaticFiles
instance
dir
- base directory
index
- show index for directory
Trait Implementations
impl<S> Handler<S> for StaticFiles
[src]
type Result = Result<FilesystemElement, Error>
The type of value that handler will return.
fn handle(&mut self, req: HttpRequest<S>) -> Self::Result
[src]
Handle request