Update README.md

This commit is contained in:
Rob Wagner 2023-07-29 17:06:49 -04:00
parent 19aadd8eab
commit e171be5cf7
No known key found for this signature in database
GPG key ID: 53CCB4497B15CF61

View file

@ -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