Skip to main content

embed_static

Macro embed_static 

Source
macro_rules! embed_static {
    () => { ... };
}
Expand description

Embed the app’s static/ directory (including the .autumn-manifest.json written by autumn build --embed) into the binary at compile time.

Expands to an include_dir::Dir rooted at the calling crate’s static/ directory (resolved via $CARGO_MANIFEST_DIR, exactly like embed_migrations!). Pass the result to AppBuilder::embedded_static:

static STATIC: autumn_web::include_dir::Dir = autumn_web::embed_static!();

#[autumn_web::main]
async fn main() {
    autumn_web::app().embedded_static(&STATIC).run().await;
}