mirror of
https://github.com/robertwayne/axum-htmx
synced 2024-11-29 14:44:33 +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 {
|
fn protected_router() -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
|
// Redirects to "/" if the HX-Request header is not present
|
||||||
.layer(HxRequestGuardLayer::default())
|
.layer(HxRequestGuardLayer::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn other_route() -> Router {
|
||||||
|
Router::new()
|
||||||
|
.layer(HxRequestGuardLayer::new("/redirect-to-this-route"))
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Feature Flags
|
### Feature Flags
|
||||||
|
|
Loading…
Reference in a new issue