Skip to content

Commit cd61276

Browse files
hyorimitsualdas
authored andcommitted
docs(routing): clarify Any registers handler for any HTTP method
1 parent 3471121 commit cd61276

5 files changed

Lines changed: 29 additions & 5 deletions

File tree

site/src/content/docs/es/guide/routing.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ e.DELETE("/users/:id", deleteUser)
2323
e.GET("/static/*", serveFiles) // wildcard
2424
```
2525

26-
`Any` registra un handler para todos los métodos soportados, y `Match` para un conjunto específico:
26+
`Any` registra un handler para cualquier método HTTP — incluidos los que no están en
27+
la lista predefinida de Echo — y `Match` para un conjunto específico:
2728

2829
```go
2930
e.Any("/ping", pong)
3031
e.Match([]string{http.MethodGet, http.MethodPost}, "/form", handleForm)
3132
```
3233

34+
:::note
35+
Una ruta de método específico registrada para el mismo path tiene precedencia sobre la ruta `Any`.
36+
:::
37+
3338
## Tipos de coincidencia
3439

3540
| Patrón | Tipo | Ejemplo de coincidencia |

site/src/content/docs/guide/routing.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ e.DELETE("/users/:id", deleteUser)
2323
e.GET("/static/*", serveFiles) // wildcard
2424
```
2525

26-
`Any` registers a handler for all supported methods, and `Match` for a specific set:
26+
`Any` registers a handler for any HTTP method — including ones not in Echo's predefined
27+
list — and `Match` for a specific set:
2728

2829
```go
2930
e.Any("/ping", pong)
3031
e.Match([]string{http.MethodGet, http.MethodPost}, "/form", handleForm)
3132
```
3233

34+
:::note
35+
A method-specific route registered for the same path takes precedence over the `Any` route.
36+
:::
37+
3338
## Match types
3439

3540
| Pattern | Type | Example match |

site/src/content/docs/ja/guide/routing.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ e.DELETE("/users/:id", deleteUser)
2424
e.GET("/static/*", serveFiles) // wildcard
2525
```
2626

27-
`Any` はサポートされているすべてのメソッドにハンドラを登録し、`Match` は指定した集合に登録します。
27+
`Any` は任意の HTTP メソッド(Echo にあらかじめ定義された一覧にないものも含む)にハンドラを
28+
登録し、`Match` は指定した集合に登録します。
2829

2930
```go
3031
e.Any("/ping", pong)
3132
e.Match([]string{http.MethodGet, http.MethodPost}, "/form", handleForm)
3233
```
3334

35+
:::note
36+
同じパスに登録されたメソッド固有のルートは、`Any` ルートより優先されます。
37+
:::
38+
3439
## マッチ種別
3540

3641
| パターン | 種別 | マッチ例 |

site/src/content/docs/pt-br/guide/routing.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ e.DELETE("/users/:id", deleteUser)
2323
e.GET("/static/*", serveFiles) // wildcard
2424
```
2525

26-
`Any` registra um handler para todos os métodos suportados, e `Match` para um conjunto específico:
26+
`Any` registra um handler para qualquer método HTTP — incluindo os que não estão na
27+
lista predefinida do Echo — e `Match` para um conjunto específico:
2728

2829
```go
2930
e.Any("/ping", pong)
3031
e.Match([]string{http.MethodGet, http.MethodPost}, "/form", handleForm)
3132
```
3233

34+
:::note
35+
Uma rota de método específico registrada para o mesmo caminho tem precedência sobre a rota `Any`.
36+
:::
37+
3338
## Tipos de correspondência
3439

3540
| Padrão | Tipo | Exemplo correspondente |

site/src/content/docs/zh-cn/guide/routing.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ e.DELETE("/users/:id", deleteUser)
2323
e.GET("/static/*", serveFiles) // wildcard
2424
```
2525

26-
`Any` 会为所有支持的方法注册处理函数`Match` 则用于一组指定方法:
26+
`Any` 会为任意 HTTP 方法(包括不在 Echo 预定义列表中的方法)注册处理函数`Match` 则用于一组指定方法:
2727

2828
```go
2929
e.Any("/ping", pong)
3030
e.Match([]string{http.MethodGet, http.MethodPost}, "/form", handleForm)
3131
```
3232

33+
:::note
34+
为同一路径注册的特定方法路由优先于 `Any` 路由。
35+
:::
36+
3337
## 匹配类型
3438

3539
| 模式 | 类型 | 匹配示例 |

0 commit comments

Comments
 (0)