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
0476a16ebc
commit
85d8a7be53
1 changed files with 2 additions and 2 deletions
|
@ -98,13 +98,13 @@ async fn get_index(HxBoosted(boosted): HxBoosted) -> impl IntoResponse {
|
||||||
use axum::Router;
|
use axum::Router;
|
||||||
use axum_htmx::HxRequestGuardLayer;
|
use axum_htmx::HxRequestGuardLayer;
|
||||||
|
|
||||||
fn protected_router() -> Router {
|
fn router_one() -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
// Redirects to "/" if the HX-Request header is not present
|
// Redirects to "/" if the HX-Request header is not present
|
||||||
.layer(HxRequestGuardLayer::default())
|
.layer(HxRequestGuardLayer::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn other_route() -> Router {
|
fn router_two() -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
.layer(HxRequestGuardLayer::new("/redirect-to-this-route"))
|
.layer(HxRequestGuardLayer::new("/redirect-to-this-route"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue