mirror of
https://github.com/robertwayne/axum-htmx
synced 2024-12-26 10:19:32 +01:00
Update README.md
This commit is contained in:
parent
19aadd8eab
commit
e171be5cf7
1 changed files with 6 additions and 0 deletions
|
@ -100,8 +100,14 @@ use axum_htmx::HxRequestGuardLayer;
|
|||
|
||||
fn protected_router() -> Router {
|
||||
Router::new()
|
||||
// Redirects to "/" if the HX-Request header is not present
|
||||
.layer(HxRequestGuardLayer::default())
|
||||
}
|
||||
|
||||
fn other_route() -> Router {
|
||||
Router::new()
|
||||
.layer(HxRequestGuardLayer::new("/redirect-to-this-route"))
|
||||
}
|
||||
```
|
||||
|
||||
### Feature Flags
|
||||
|
|
Loading…
Reference in a new issue