Skip to content

Commit

Permalink
add excluded paths note to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tronicboy1 committed Jan 24, 2024
1 parent 243405b commit 333a386
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ let router = axum::Router::new()
For `RedirectMode::RedirectToFullLocaleSubPath` or `RedirectMode::RedirectToLanguageSubPath`, you must wrap this service/middleware around the entire
axum app, as explained [here](https://docs.rs/axum/latest/axum/middleware/index.html#rewriting-request-uri-in-middleware).

When using the subpath redirect modes, you may want to exclude some folders from the redirect as below:

```rust
let l10n_middleware = axum_l10n::LanguageIdentifierExtractorLayer::new(
JAPANESE,
vec![JAPANESE, ENGLISH],
axum_l10n::RedirectMode::RedirectToLanguageSubPath,
)
.excluded_paths(&["/api", "/assets", "/auth"]);
```

# Features

## fluent
Expand Down

0 comments on commit 333a386

Please sign in to comment.