Skip to content

Commit de840c5

Browse files
authored
Clarify how to use urlpattern matching (#882)
1 parent 9dc3da5 commit de840c5

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/articles/advanced-path-matching.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ However, you can opt to use a more advanced path matching approach based on the
1616
web standard
1717
[URLPattern](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern).
1818

19+
In order to use URLPattern matching you must set your route's
20+
`x-zuplo-path.pathMode` to `url-pattern`.
21+
22+
The URLPattern matching mode can be set in the UI as shown below:
23+
24+
![Route ](../../public/media/advanced-path-matching/image.png)
25+
26+
Alternatively, you can set it in your OpenAPI file as follows:
27+
28+
```json {4-6} title="config/routes.oas.json"
29+
{
30+
"paths": {
31+
"/files/:path*": {
32+
"x-zuplo-path": {
33+
"pathMode": "url-pattern"
34+
}
35+
}
36+
}
37+
}
38+
```
39+
1940
The most basic path is `/` which will simple match the root path. You can add
2041
other static paths like `/foo` and `/foo/bar`
2142

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)