~repos /rust-embed
git clone https://pyrossh.dev/repos/rust-embed.git
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
20c6c7fc
—
frederikhors 3 years ago
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();
|