You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/servable/README.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ async fn main() {
32
32
"/hello",
33
33
StaticAsset {
34
34
bytes: b"Hello, World!",
35
-
mime: MimeType::Text,
35
+
mime: mime::TEXT_PLAIN
36
36
},
37
37
);
38
38
@@ -56,11 +56,11 @@ The `Servable` trait is the foundation of this stack. \
56
56
57
57
-`StaticAsset`, for static files like CSS, JavaScript, images, or plain bytes:
58
58
```rust
59
-
use servable::{StaticAsset, mime::MimeType};
59
+
use servable::{StaticAsset};
60
60
61
61
let asset = StaticAsset {
62
62
bytes: b"body { color: red; }",
63
-
mime: MimeType::Css,
63
+
mime: mime::TEXT_CSS,
64
64
ttl: StaticAsset::DEFAULT_TTL
65
65
};
66
66
```
@@ -102,11 +102,11 @@ The `Servable` trait is the foundation of this stack. \
102
102
A `ServableRouter` exposes a collection of `Servable`s under different routes. It implements `tower`'s `Service` trait, and can be easily be converted into an Axum `Router`. Construct one as follows:
0 commit comments