Skip to content

Commit 7d2dd18

Browse files
structwafelpaolobarbolini
authored andcommitted
docs: update tests and README for ignore_paths
1 parent 372e3e4 commit 7d2dd18

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Use the `embed_assets!` macro to create a `static_router()` function in scope wh
3131
```rust
3232
use static_serve::embed_assets;
3333

34-
embed_assets!("assets", compress = true, ignore_files = ["temp.txt"], cache_busted_paths = ["immutable"]);
34+
embed_assets!("assets", compress = true, ignore_paths = ["temp.txt","temp"], cache_busted_paths = ["immutable"]);
3535
let router = static_router();
3636
```
3737

3838
This will:
3939

40-
- Include all files from the `assets` directory except `temp.txt`
40+
- Include all files from the `assets` directory except `temp.txt` and the `temp` directory
4141
- Compress them using `gzip` and `zstd` (if beneficial)
4242
- For only files in `assets/immutable`, add a `Cache-Control` header with `public, max-age=31536000, immutable` (since these are marked as cache-busted paths)
4343
- Generate a `static_router()` function to serve these assets

static-serve/tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ async fn handles_dir_with_cache_control_on_filename_and_dir() {
10811081
}
10821082

10831083
#[tokio::test]
1084-
async fn router_created_ignore_files() {
1084+
async fn router_created_ignore_paths() {
10851085
embed_assets!(
10861086
"../static-serve/test_assets/small",
10871087
ignore_paths = ["app.js"]

0 commit comments

Comments
 (0)