Trait ServeStatic

Source
pub trait ServeStatic {
    // Required method
    fn serve_static(&mut self, root_dir: Option<String>);
}
Expand description

Provide HttpServer the ability to serve static files

server.serve_static(None);      // Default folder is "public"
server.serve_static(Some(String::from("your_dir")));

Required Methods§

Source

fn serve_static(&mut self, root_dir: Option<String>)

Serve files in the root_dir folder. Default root dir is public.

Implementors§