Macro fire_http::memory_file
source · macro_rules! memory_file { ($uri:expr, $path:expr) => { ... }; ($uri:expr, $path:expr, $duration:expr) => { ... }; }
Available on crate feature
fs only.Expand description
Static get handler which servers/returns a file which gets loaded into the binary at compile time.
§Example
use std::time::Duration;
use fire::fs::MemoryFile;
use fire::memory_file;
const INDEX: MemoryFile = memory_file!(
"/",
"../../examples/www/hello_world.html"
);
const INDEX_WITH_CACHE: MemoryFile = memory_file!(
"/",
"../../examples/www/hello_world.html",
Duration::from_secs(10)
);