Skip to content

Commit

Permalink
chore: Fix doc example for domain routing
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeMathWalker committed Nov 26, 2024
1 parent 4a72e6b commit 89c920a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use pavex::f;
pub fn bp() -> Blueprint {
let mut bp = Blueprint::new();
bp.domain("{*any}.pavex.dev").nest(sub_bp());
bp.domain("{*any}.example.dev").nest(sub_bp());
bp
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use pavex::f;

pub fn bp() -> Blueprint {
let mut bp = Blueprint::new();
bp.domain("{*any}.pavex.dev").nest(sub_bp());
bp.domain("{*any}.example.dev").nest(sub_bp());
bp
}

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/routing/domain_guards.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ You can use the `*` character to craft a **catch-all domain parameter**. It matc

--8<-- "doc_examples/guide/routing/domain_guards/project-catch_all.snap"

`{*any}` matches everything **before** `pavex.dev`, even if it contains `.` separators.
`{*any}.pavex.dev` matches, for example, `api.pavex.dev` and `ui.pavex.dev`, but it also matches `admin.api.pavex.dev`.
`{*any}` matches everything **before** `example.dev`, even if it contains `.` separators.
`{*any}.example.dev` matches, for example, `api.example.dev` and `ui.example.dev`, but it also matches `admin.api.example.dev`.

To avoid ambiguity,
you can have **at most one catch-all parameter in a domain guard** and it must be located **at the very beginning of the domain**.
Expand Down

0 comments on commit 89c920a

Please sign in to comment.