Skip to content

Commit

Permalink
Update rewrite.md
Browse files Browse the repository at this point in the history
In the last example the Rules And RegexRules from the config structure are shown as Rewrite and RewriteRules instead.
  • Loading branch information
nicolasrod authored and aldas committed Jun 8, 2023
1 parent 6932acf commit b81356d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/content/middleware/rewrite.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ Normal capture groups can be defined using `()` and referenced by index (`$1`, `

```go
e.Pre(RewriteWithConfig(RewriteConfig{
Rewrite: map[string]string{
Rules: map[string]string{
"^/v1/*": "/v2/$1",
},
RegexRewrite: map[*regexp.Regexp]string{
RegexRules: map[*regexp.Regexp]string{
regexp.MustCompile("^/foo/([0-9].*)"): "/num/$1",
regexp.MustCompile("^/bar/(.+?)/(.*)"): "/baz/$2/$1",
},
Expand Down

0 comments on commit b81356d

Please sign in to comment.