static_handler

Function static_handler 

Source
pub fn static_handler(
    config: StaticFileConfig,
) -> impl Fn(Request) -> Pin<Box<dyn Future<Output = Response> + Send>> + Clone + Send + Sync + 'static
Expand description

Create a handler for serving static files

§Example

use rustapi_core::static_files::{static_handler, StaticFileConfig};

let config = StaticFileConfig::new("./public", "/assets");
let handler = static_handler(config);