rust-embed v8.11.0
git clone https://git.pyrossh.dev/rust-embed
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
20c6c7f
— frederikhors
2022-08-28T17:14:54+02:00
use path only
examples/axum-spa/main.rs
CHANGED
|
@@ -33,7 +33,7 @@ async fn static_handler(uri: Uri) -> impl IntoResponse {
|
|
|
33
33
|
return index_html().await.into_response();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
match Assets::get(path
|
|
36
|
+
match Assets::get(path) {
|
|
37
37
|
Some(content) => {
|
|
38
38
|
let body = boxed(Full::from(content.data));
|
|
39
39
|
let mime = mime_guess::from_path(path).first_or_octet_stream();
|