Update README.md

This commit is contained in:
Rob Wagner 2023-07-29 17:10:02 -04:00
parent 0476a16ebc
commit 85d8a7be53
No known key found for this signature in database
GPG key ID: 53CCB4497B15CF61

View file

@ -98,13 +98,13 @@ async fn get_index(HxBoosted(boosted): HxBoosted) -> impl IntoResponse {
use axum::Router;
use axum_htmx::HxRequestGuardLayer;
fn protected_router() -> Router {
fn router_one() -> Router {
Router::new()
// Redirects to "/" if the HX-Request header is not present
.layer(HxRequestGuardLayer::default())
}
fn other_route() -> Router {
fn router_two() -> Router {
Router::new()
.layer(HxRequestGuardLayer::new("/redirect-to-this-route"))
}