diff --git a/site/src/content/docs/es/cookbook/http2.md b/site/src/content/docs/es/cookbook/http2.md
index 2ba77367..4566bfb3 100644
--- a/site/src/content/docs/es/cookbook/http2.md
+++ b/site/src/content/docs/es/cookbook/http2.md
@@ -9,6 +9,8 @@ HTTP/2 mejora la latencia mediante multiplexing de requests, compresión de head
server push. El servidor HTTP de Go negocia HTTP/2 automáticamente sobre TLS, por lo que
servir HTTP/2 con Echo consiste en iniciar el servidor con un certificado.
+
+
## 1. Generar un certificado TLS X.509 autofirmado
Ejecuta el siguiente comando para generar `cert.pem` y `key.pem`:
diff --git a/site/src/content/docs/es/guide/binding.md b/site/src/content/docs/es/guide/binding.md
index 135b49ed..0e338050 100644
--- a/site/src/content/docs/es/guide/binding.md
+++ b/site/src/content/docs/es/guide/binding.md
@@ -148,6 +148,8 @@ Cada tipo soportado ofrece métodos `Type(...)`, `MustType(...)`, `Types(...)` (
`MustTypes(...)`, por ejemplo `Int64`, `MustInt64`, `Int64s`. Usa
`BindWithDelimiter("id", &dest, ",")` para separar valores unidos por comas.
+
+
## Binder personalizado
Registra un binder personalizado mediante `Echo#Binder`:
diff --git a/site/src/content/docs/es/guide/customization.md b/site/src/content/docs/es/guide/customization.md
index e9759c52..2762f6f8 100644
--- a/site/src/content/docs/es/guide/customization.md
+++ b/site/src/content/docs/es/guide/customization.md
@@ -43,6 +43,8 @@ en [json.go](https://github.com/labstack/echo/blob/master/json.go).
[Aprende más](/es/guide/templates/)
+
+
## Handler de errores HTTP
`Echo#HTTPErrorHandler` registra un handler de errores HTTP personalizado.
diff --git a/site/src/content/docs/es/guide/request.md b/site/src/content/docs/es/guide/request.md
index 2e17ed2d..21264784 100644
--- a/site/src/content/docs/es/guide/request.md
+++ b/site/src/content/docs/es/guide/request.md
@@ -106,6 +106,8 @@ curl http://localhost:1323/users/123
Echo también puede vincular datos de request a structs y variables nativas de Go. Consulta
[Binding](/es/guide/binding/).
+
+
## Validar datos
Echo no incluye validación de datos integrada. Puedes registrar un validator personalizado mediante
diff --git a/site/src/content/docs/es/middleware/basic-auth.md b/site/src/content/docs/es/middleware/basic-auth.mdx
similarity index 67%
rename from site/src/content/docs/es/middleware/basic-auth.md
rename to site/src/content/docs/es/middleware/basic-auth.mdx
index 0ce5538e..be22c7d2 100644
--- a/site/src/content/docs/es/middleware/basic-auth.md
+++ b/site/src/content/docs/es/middleware/basic-auth.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 1
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Basic Auth proporciona autenticación HTTP basic.
- Para credenciales válidas llama al siguiente handler.
@@ -37,27 +39,7 @@ e.Use(middleware.BasicAuthWithConfig(middleware.BasicAuthConfig{}))
## Configuración
-```go
-type BasicAuthConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Validator validates the credentials. If the request contains multiple basic
- // auth headers, it is called once for each header until the first valid result.
- // Required.
- Validator BasicAuthValidator
-
- // Realm is the realm attribute of the WWW-Authenticate header.
- // Default value "Restricted".
- Realm string
-
- // AllowedCheckLimit sets how many headers are allowed to be checked. This is
- // useful in environments such as corporate test setups with application proxies
- // restricting access with their own auth scheme.
- // Default value 1.
- AllowedCheckLimit uint
-}
-```
+
`Validator` tiene esta firma:
diff --git a/site/src/content/docs/es/middleware/body-dump.md b/site/src/content/docs/es/middleware/body-dump.mdx
similarity index 59%
rename from site/src/content/docs/es/middleware/body-dump.md
rename to site/src/content/docs/es/middleware/body-dump.mdx
index 5de4d32e..64c92cf9 100644
--- a/site/src/content/docs/es/middleware/body-dump.md
+++ b/site/src/content/docs/es/middleware/body-dump.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 2
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Body Dump captura los payloads de request y response y los pasa a un
handler registrado. Generalmente se usa para debugging o logging.
@@ -37,28 +39,7 @@ e.Use(middleware.BodyDumpWithConfig(middleware.BodyDumpConfig{}))
## Configuración
-```go
-type BodyDumpConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Handler receives the request and response payloads and the handler error, if any.
- // Required.
- Handler BodyDumpHandler
-
- // MaxRequestBytes limits how much of the request body to dump. If the request body
- // exceeds this limit, only the first MaxRequestBytes are dumped and the handler
- // receives truncated data.
- // Default: 5 * MB (5,242,880 bytes). Set to -1 to disable limits (not recommended).
- MaxRequestBytes int64
-
- // MaxResponseBytes limits how much of the response body to dump. If the response body
- // exceeds this limit, only the first MaxResponseBytes are dumped and the handler
- // receives truncated data.
- // Default: 5 * MB (5,242,880 bytes). Set to -1 to disable limits (not recommended).
- MaxResponseBytes int64
-}
-```
+
`Handler` tiene esta firma:
diff --git a/site/src/content/docs/es/middleware/body-limit.md b/site/src/content/docs/es/middleware/body-limit.mdx
similarity index 83%
rename from site/src/content/docs/es/middleware/body-limit.md
rename to site/src/content/docs/es/middleware/body-limit.mdx
index 2a19b210..8364609d 100644
--- a/site/src/content/docs/es/middleware/body-limit.md
+++ b/site/src/content/docs/es/middleware/body-limit.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 3
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Body Limit establece el tamaño máximo permitido para un body de request. Si el tamaño
supera el límite configurado, envía una response `413 Request Entity Too Large`.
@@ -33,15 +35,7 @@ e.Use(middleware.BodyLimitWithConfig(middleware.BodyLimitConfig{}))
## Configuración
-```go
-type BodyLimitConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // LimitBytes is the maximum allowed size in bytes for a request body.
- LimitBytes int64
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/context-timeout.md b/site/src/content/docs/es/middleware/context-timeout.mdx
similarity index 73%
rename from site/src/content/docs/es/middleware/context-timeout.md
rename to site/src/content/docs/es/middleware/context-timeout.mdx
index e6754080..b0a5ef2c 100644
--- a/site/src/content/docs/es/middleware/context-timeout.md
+++ b/site/src/content/docs/es/middleware/context-timeout.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 5
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Context Timeout aplica un timeout al contexto del request dentro de un periodo
predefinido, para que los métodos conscientes del contexto puedan retornar antes cuando se supera el deadline.
@@ -30,18 +32,7 @@ e.Use(middleware.ContextTimeoutWithConfig(middleware.ContextTimeoutConfig{
## Configuración
-```go
-type ContextTimeoutConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // ErrorHandler is a function invoked when an error arises during middleware execution.
- ErrorHandler func(c *echo.Context, err error) error
-
- // Timeout configures the timeout for the middleware.
- Timeout time.Duration
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/cors.md b/site/src/content/docs/es/middleware/cors.md
deleted file mode 100644
index 139e5514..00000000
--- a/site/src/content/docs/es/middleware/cors.md
+++ /dev/null
@@ -1,139 +0,0 @@
----
-title: CORS
-description: Middleware Cross-Origin Resource Sharing para control de acceso seguro entre dominios.
-sidebar:
- order: 6
----
-
-El middleware CORS implementa la especificación [CORS](https://fetch.spec.whatwg.org/#http-cors-protocol).
-CORS da a los servidores web controles de acceso entre dominios, lo que permite transferencias de datos seguras entre dominios.
-
-Todo el middleware principal reside en el paquete `middleware`:
-
-```go
-import "github.com/labstack/echo/v5/middleware"
-```
-
-## Uso
-
-```go
-e.Use(middleware.CORS("https://example.com", "https://subdomain.example.com"))
-```
-
-## Configuración personalizada
-
-```go
-e := echo.New()
-e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
- AllowOrigins: []string{"https://labstack.com", "https://labstack.net"},
- AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept},
-}))
-```
-
-## Configuración
-
-```go
-type CORSConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // AllowOrigins determines the value of the Access-Control-Allow-Origin response
- // header, defining the list of origins that may access the resource.
- //
- // An origin consists of: scheme + "://" + host + optional ":" + port.
- // A wildcard may be used, but it must be set explicitly as []string{"*"}.
- // Example: `https://example.com`, `http://example.com:8080`, `*`.
- //
- // Security: use extreme caution when handling the origin and carefully validate any
- // logic. Attackers may register hostile domain names. See
- // https://blog.portswigger.net/2016/10/exploiting-cors-misconfigurations-for.html
- //
- // Mandatory.
- AllowOrigins []string
-
- // UnsafeAllowOriginFunc is an optional custom function to validate the origin. It
- // takes the origin and returns the allowed origin, whether it is allowed, and an
- // error (returned immediately by the handler). If set, AllowOrigins is ignored.
- //
- // Security: use extreme caution when handling the origin. Attackers may register
- // hostile (sub)domain names.
- //
- // Sub-domain check example:
- // UnsafeAllowOriginFunc: func(c *echo.Context, origin string) (string, bool, error) {
- // if strings.HasSuffix(origin, ".example.com") {
- // return origin, true, nil
- // }
- // return "", false, nil
- // }
- //
- // Optional.
- UnsafeAllowOriginFunc func(c *echo.Context, origin string) (allowedOrigin string, allowed bool, err error)
-
- // AllowMethods determines the value of the Access-Control-Allow-Methods response
- // header, used in response to a preflight request.
- //
- // Optional. Defaults to GET, HEAD, PUT, PATCH, POST, DELETE. If left empty, the
- // middleware fills the preflight Access-Control-Allow-Methods header from the
- // `Allow` header that the router set into the context.
- AllowMethods []string
-
- // AllowHeaders determines the value of the Access-Control-Allow-Headers response
- // header, indicating which HTTP headers can be used in the actual request.
- //
- // Optional. Defaults to an empty list.
- AllowHeaders []string
-
- // AllowCredentials determines the value of the Access-Control-Allow-Credentials
- // response header, indicating whether the response can be exposed when the
- // credentials mode is true.
- //
- // Optional. Default value false, in which case the header is not set.
- //
- // Security: avoid using AllowCredentials = true together with AllowOrigins = *.
- AllowCredentials bool
-
- // ExposeHeaders determines the value of Access-Control-Expose-Headers, the list of
- // headers clients are allowed to access.
- //
- // Optional. Default value []string{}, in which case the header is not set.
- ExposeHeaders []string
-
- // MaxAge determines the value of the Access-Control-Max-Age response header, how long
- // (in seconds) the results of a preflight request can be cached. The header is set
- // only if MaxAge != 0; a negative value sends "0", instructing browsers not to cache.
- //
- // Optional. Default value 0 — the header is not sent.
- MaxAge int
-}
-```
-
-### Configuración por defecto
-
-```go
-// Effective defaults applied when fields are left unset.
-CORSConfig{
- Skipper: DefaultSkipper,
- AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
-}
-```
-
-## Seguridad
-
-Un origin con wildcard (`AllowOrigins: []string{"*"}`) combinado con `AllowCredentials: true`
-es peligroso: reflejaría el `Origin` de **cualquier** petición en
-`Access-Control-Allow-Origin`, permitiendo que una página de cualquier sitio haga peticiones
-cross-origin con credenciales a tu API (consulta [Exploiting CORS misconfigurations](https://blog.portswigger.net/2016/10/exploiting-cors-misconfigurations-for.html)).
-
-Echo rechaza esta combinación en lugar de construir un middleware inseguro: `CORS` y
-`CORSWithConfig` hacen **panic**, y `CORSConfig.ToMiddleware()` devuelve un error. Para permitir
-peticiones con credenciales, enumera explícitamente los orígenes de confianza:
-
-```go
-e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
- AllowOrigins: []string{"https://example.com"},
- AllowCredentials: true,
-}))
-```
-
-Para validación dinámica de origin, usa `UnsafeAllowOriginFunc` y valida cada origin con
-cuidado: los atacantes pueden registrar nombres de (sub)dominio falsos u hostiles.
diff --git a/site/src/content/docs/es/middleware/cors.mdx b/site/src/content/docs/es/middleware/cors.mdx
new file mode 100644
index 00000000..31250f88
--- /dev/null
+++ b/site/src/content/docs/es/middleware/cors.mdx
@@ -0,0 +1,68 @@
+---
+title: CORS
+description: Middleware Cross-Origin Resource Sharing para control de acceso seguro entre dominios.
+sidebar:
+ order: 6
+---
+
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
+El middleware CORS implementa la especificación [CORS](https://fetch.spec.whatwg.org/#http-cors-protocol).
+CORS da a los servidores web controles de acceso entre dominios, lo que permite transferencias de datos seguras entre dominios.
+
+Todo el middleware principal reside en el paquete `middleware`:
+
+```go
+import "github.com/labstack/echo/v5/middleware"
+```
+
+## Uso
+
+```go
+e.Use(middleware.CORS("https://example.com", "https://subdomain.example.com"))
+```
+
+## Configuración personalizada
+
+```go
+e := echo.New()
+e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
+ AllowOrigins: []string{"https://labstack.com", "https://labstack.net"},
+ AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept},
+}))
+```
+
+## Configuración
+
+
+
+### Configuración por defecto
+
+```go
+// Effective defaults applied when fields are left unset.
+CORSConfig{
+ Skipper: DefaultSkipper,
+ AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
+}
+```
+
+## Seguridad
+
+Un origin con wildcard (`AllowOrigins: []string{"*"}`) combinado con `AllowCredentials: true`
+es peligroso: reflejaría el `Origin` de **cualquier** petición en
+`Access-Control-Allow-Origin`, permitiendo que una página de cualquier sitio haga peticiones
+cross-origin con credenciales a tu API (consulta [Exploiting CORS misconfigurations](https://blog.portswigger.net/2016/10/exploiting-cors-misconfigurations-for.html)).
+
+Echo rechaza esta combinación en lugar de construir un middleware inseguro: `CORS` y
+`CORSWithConfig` hacen **panic**, y `CORSConfig.ToMiddleware()` devuelve un error. Para permitir
+peticiones con credenciales, enumera explícitamente los orígenes de confianza:
+
+```go
+e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
+ AllowOrigins: []string{"https://example.com"},
+ AllowCredentials: true,
+}))
+```
+
+Para validación dinámica de origin, usa `UnsafeAllowOriginFunc` y valida cada origin con
+cuidado: los atacantes pueden registrar nombres de (sub)dominio falsos u hostiles.
diff --git a/site/src/content/docs/es/middleware/csrf.md b/site/src/content/docs/es/middleware/csrf.mdx
similarity index 61%
rename from site/src/content/docs/es/middleware/csrf.md
rename to site/src/content/docs/es/middleware/csrf.mdx
index 787796dc..1b4ae669 100644
--- a/site/src/content/docs/es/middleware/csrf.md
+++ b/site/src/content/docs/es/middleware/csrf.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 7
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
Cross-Site Request Forgery (CSRF, a veces pronunciado "sea-surf", o XSRF) es un tipo de
exploit malicioso en el que se transmiten comandos no autorizados desde un usuario en el que
un sitio web confía.
@@ -93,75 +95,7 @@ middleware.CSRFWithConfig(middleware.CSRFConfig{
## Configuración
-```go
-type CSRFConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // TrustedOrigins permits any request with a `Sec-Fetch-Site` header whose `Origin`
- // header exactly matches one of the listed values. Values should be formatted as
- // the Origin header: "scheme://host[:port]".
- TrustedOrigins []string
-
- // AllowSecFetchSiteFunc allows custom behaviour for `Sec-Fetch-Site` requests that
- // are about to fail with a CSRF error, to be allowed or replaced with a custom
- // error. Applies to `same-site` and `cross-site` values.
- AllowSecFetchSiteFunc func(c *echo.Context) (bool, error)
-
- // TokenLength is the length of the generated token.
- // Optional. Default value 32.
- TokenLength uint8
-
- // TokenLookup is a string in the form ":" or
- // ":,:" used to extract the token from the request.
- // Optional. Default value "header:X-CSRF-Token".
- // Possible values:
- // - "header:" or "header::"
- // - "query:"
- // - "form:"
- // Multiple sources example: "header:X-CSRF-Token,query:csrf".
- TokenLookup string `yaml:"token_lookup"`
-
- // Generator defines a function to generate the token.
- // Optional. Defaults to randomString(TokenLength).
- Generator func() string
-
- // ContextKey is the key under which the generated CSRF token is stored in the context.
- // Optional. Default value "csrf".
- ContextKey string
-
- // CookieName is the name of the CSRF cookie that stores the token.
- // Optional. Default value "_csrf".
- CookieName string
-
- // CookieDomain is the domain of the CSRF cookie.
- // Optional. Default value none.
- CookieDomain string
-
- // CookiePath is the path of the CSRF cookie.
- // Optional. Default value none.
- CookiePath string
-
- // CookieMaxAge is the max age (in seconds) of the CSRF cookie.
- // Optional. Default value 86400 (24h).
- CookieMaxAge int
-
- // CookieSecure indicates whether the CSRF cookie is secure.
- // Optional. Default value false.
- CookieSecure bool
-
- // CookieHTTPOnly indicates whether the CSRF cookie is HTTP only.
- // Optional. Default value false.
- CookieHTTPOnly bool
-
- // CookieSameSite indicates the SameSite mode of the CSRF cookie.
- // Optional. Default value SameSiteDefaultMode.
- CookieSameSite http.SameSite
-
- // ErrorHandler defines a function that returns custom errors.
- ErrorHandler func(c *echo.Context, err error) error
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/decompress.md b/site/src/content/docs/es/middleware/decompress.mdx
similarity index 61%
rename from site/src/content/docs/es/middleware/decompress.md
rename to site/src/content/docs/es/middleware/decompress.mdx
index 9381e08a..976baba0 100644
--- a/site/src/content/docs/es/middleware/decompress.md
+++ b/site/src/content/docs/es/middleware/decompress.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 8
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Decompress descomprime el body del request HTTP cuando el header
`Content-Encoding` está establecido en `gzip`.
@@ -36,22 +38,7 @@ e.Use(middleware.DecompressWithConfig(middleware.DecompressConfig{
## Configuración
-```go
-type DecompressConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // GzipDecompressPool provides the sync.Pool used to create and store gzip readers.
- GzipDecompressPool Decompressor
-
- // MaxDecompressedSize limits the maximum size of the decompressed request body in
- // bytes. If the decompressed body exceeds this limit, the middleware returns an
- // HTTP 413 error. This prevents zip-bomb attacks where a small compressed payload
- // decompresses to a huge size.
- // Default: 100 * MB (104,857,600 bytes). Set to -1 to disable limits (not recommended).
- MaxDecompressedSize int64
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/gzip.md b/site/src/content/docs/es/middleware/gzip.mdx
similarity index 62%
rename from site/src/content/docs/es/middleware/gzip.md
rename to site/src/content/docs/es/middleware/gzip.mdx
index 25e40e07..9e2ea1dd 100644
--- a/site/src/content/docs/es/middleware/gzip.md
+++ b/site/src/content/docs/es/middleware/gzip.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 9
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Gzip comprime la response HTTP usando el esquema de compresión gzip.
Todo el middleware principal reside en el paquete `middleware`:
@@ -43,25 +45,7 @@ e.Use(middleware.GzipWithConfig(middleware.GzipConfig{
## Configuración
-```go
-type GzipConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Level is the gzip compression level.
- // Optional. Default value -1.
- Level int
-
- // MinLength is the length threshold before gzip compression is applied.
- // Optional. Default value 0.
- //
- // Most of the time the default is fine. Compressing a short response might increase
- // the transmitted data because of gzip's format overhead, and compression consumes
- // CPU and time on both server and client. Depending on your use case such a
- // threshold can be useful.
- MinLength int
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/index.md b/site/src/content/docs/es/middleware/index.md
new file mode 100644
index 00000000..9ee5d940
--- /dev/null
+++ b/site/src/content/docs/es/middleware/index.md
@@ -0,0 +1,30 @@
+---
+title: Elige un middleware
+description: Empieza por la tarea, sigue un ejemplo ejecutable y consulta la API exacta de Echo.
+sidebar:
+ order: 0
+---
+
+¿Nuevo en Echo? Crea primero un servidor con la [guía de inicio](../guide/quickstart/). Cada página explica cuándo usar el middleware, muestra cómo configurarlo y presenta campos y firmas tomados de una revisión concreta de Echo.
+
+## ¿Qué necesitas hacer?
+
+| Tarea | Empieza aquí | Pruébalo |
+| --- | --- | --- |
+| Ver peticiones y errores | [Request Logger](./logger/) y [Recover](./recover/) | Ejecuta el [ejemplo de logging](./logger/) |
+| Permitir peticiones desde el navegador | [CORS](./cors/) | Usa orígenes de confianza explícitos |
+| Proteger formularios | [CSRF](./csrf/) | Elige cómo guardar el token |
+| Autenticar una API | [JWT](./jwt/) | Ejecuta el [recetario de JWT](../cookbook/jwt/) |
+| Limitar peticiones abusivas | [Rate Limiter](./rate-limiter/) | Elige identificador y almacenamiento |
+| Servir archivos | [Static](./static/) | Ejecuta el [ejemplo de archivos estáticos](./static/) |
+| Reenviar peticiones | [Proxy](./proxy/) | Ejecuta el [recetario de proxy inverso](../cookbook/reverse-proxy/) |
+
+## Del código a una petición real
+
+1. Elige una tarea y copia el ejemplo de uso más pequeño.
+2. Consulta la configuración para ver los campos y firmas de la revisión indicada de Echo. Lee los valores por defecto y las notas de seguridad antes de cambiar el comportamiento.
+3. Ejecuta el ejemplo completo o la receta enlazada y envía una petición con `curl`.
+
+Para una primera API, sigue con [rutas](../guide/routing/), [binding](../guide/binding/), [gestión de errores](../guide/error-handling/) y [pruebas](../guide/testing/). Para tráfico de producción, añade [Recover](./recover/) y [Request Logger](./logger/) antes de elegir los middleware de seguridad.
+
+Integraciones como JWT se mantienen en módulos separados; sus páginas indican el paquete responsable. La API del middleware principal está en [`github.com/labstack/echo/v5/middleware`](https://pkg.go.dev/github.com/labstack/echo/v5/middleware).
diff --git a/site/src/content/docs/es/middleware/jwt.md b/site/src/content/docs/es/middleware/jwt.md
deleted file mode 100644
index 97cbbd8f..00000000
--- a/site/src/content/docs/es/middleware/jwt.md
+++ /dev/null
@@ -1,126 +0,0 @@
----
-title: JWT
-description: Middleware de autenticación JSON Web Token provisto por el módulo echo-jwt.
-sidebar:
- order: 10
----
-
-El middleware JWT proporciona autenticación JSON Web Token (JWT). Vive en un módulo separado:
-[github.com/labstack/echo-jwt](https://github.com/labstack/echo-jwt).
-
-Comportamiento:
-
-- Para un token válido, establece el usuario en el contexto y llama al siguiente handler.
-- Para un token inválido, envía una response `401 Unauthorized`.
-- Para un header `Authorization` ausente o inválido, envía una response `400 Bad Request`.
-
-## Dependencias
-
-```go
-import "github.com/labstack/echo-jwt/v5"
-```
-
-## Uso
-
-```go
-e.Use(echojwt.JWT([]byte("secret")))
-```
-
-## Configuración personalizada
-
-```go
-e.Use(echojwt.WithConfig(echojwt.Config{
- SigningKey: []byte("secret"),
-}))
-```
-
-## Configuración
-
-```go
-type Config struct {
- // Skipper defines a function to skip middleware.
- Skipper middleware.Skipper
-
- // BeforeFunc defines a function which is executed just before the middleware.
- BeforeFunc middleware.BeforeFunc
-
- // SuccessHandler defines a function executed for a valid token. If it returns an
- // error, the middleware stops the handler chain and returns that error.
- SuccessHandler func(c *echo.Context) error
-
- // ErrorHandler defines a function executed when all lookups have been done and none
- // passed the Validator. It runs with the last missing (ErrExtractionValueMissing)
- // or invalid key, and may be used to define a custom JWT error.
- //
- // Note: when the error handler swallows the error (returns nil), the middleware
- // continues the handler chain. This is useful when part of your site/api is public
- // and offers extra features for authorized users; the handler can set a default
- // public JWT token value in the request and continue.
- ErrorHandler func(c *echo.Context, err error) error
-
- // ContinueOnIgnoredError allows the next middleware/handler to be called when the
- // ErrorHandler ignores the error (returns nil).
- ContinueOnIgnoredError bool
-
- // ContextKey is the key under which user information from the token is stored in the context.
- // Optional. Default value "user".
- ContextKey string
-
- // SigningKey is the signing key used to validate the token. One of the three options
- // to provide a token validation key. Order of precedence: user-defined KeyFunc,
- // SigningKeys, then SigningKey.
- // Required if neither a user-defined KeyFunc nor SigningKeys is provided.
- SigningKey any
-
- // SigningKeys is a map of signing keys to validate tokens using the kid field. One of
- // the three options to provide a token validation key.
- // Required if neither a user-defined KeyFunc nor SigningKey is provided.
- SigningKeys map[string]any
-
- // SigningMethod is the signing method used to check the token's signing algorithm.
- // Not checked when a user-defined KeyFunc is provided.
- // Optional. Default value HS256.
- SigningMethod string
-
- // KeyFunc supplies the public key for token validation. It must verify the signing
- // algorithm and select the proper key. Useful when tokens are issued by an external
- // party. When provided, SigningKey, SigningKeys and SigningMethod are ignored.
- // One of the three options to provide a token validation key, and not used if a
- // custom ParseTokenFunc is set.
- KeyFunc jwt.Keyfunc
-
- // TokenLookup is a string in the form ":" or
- // ":,:" used to extract the token from the request.
- // Optional. Default value "header:Authorization".
- // Possible values:
- // - "header:" or "header::"
- // trims a static prefix from the extracted value. For JWT tokens with
- // `Authorization: Bearer `, the prefix to cut is `Bearer ` (note the space).
- // If the prefix is empty, the whole value is returned.
- // - "query:"
- // - "param:"
- // - "cookie:"
- // - "form:"
- // Multiple sources example: "header:Authorization:Bearer ,cookie:myowncookie".
- TokenLookup string
-
- // TokenLookupFuncs is a list of user-defined functions that extract the JWT token
- // from the context. One of two options to provide a token extractor. Order of
- // precedence: TokenLookupFuncs, then TokenLookup. Both may be provided.
- TokenLookupFuncs []middleware.ValuesExtractor
-
- // ParseTokenFunc parses the token from the given auth string, returning an error when
- // parsing fails or the token is invalid.
- // Defaults to an implementation using github.com/golang-jwt/jwt.
- ParseTokenFunc func(c *echo.Context, auth string) (any, error)
-
- // NewClaimsFunc returns the extendable claims defining token content. Used by the
- // default ParseTokenFunc; not used if a custom ParseTokenFunc is set.
- // Optional. Defaults to a function returning jwt.MapClaims.
- NewClaimsFunc func(c *echo.Context) jwt.Claims
-}
-```
-
-## Ejemplo
-
-Consulta el [recetario de JWT](/es/cookbook/jwt/) para ver un ejemplo completo.
diff --git a/site/src/content/docs/es/middleware/jwt.mdx b/site/src/content/docs/es/middleware/jwt.mdx
new file mode 100644
index 00000000..6a404d5b
--- /dev/null
+++ b/site/src/content/docs/es/middleware/jwt.mdx
@@ -0,0 +1,45 @@
+---
+title: JWT
+description: Middleware de autenticación JSON Web Token provisto por el módulo echo-jwt.
+sidebar:
+ order: 10
+---
+
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
+El middleware JWT proporciona autenticación JSON Web Token (JWT). Vive en un módulo separado:
+[github.com/labstack/echo-jwt](https://github.com/labstack/echo-jwt).
+
+Comportamiento:
+
+- Para un token válido, establece el usuario en el contexto y llama al siguiente handler.
+- Para un token inválido, envía una response `401 Unauthorized`.
+- Para un header `Authorization` ausente o inválido, envía una response `400 Bad Request`.
+
+## Dependencias
+
+```go
+import "github.com/labstack/echo-jwt/v5"
+```
+
+## Uso
+
+```go
+e.Use(echojwt.JWT([]byte("secret")))
+```
+
+## Configuración personalizada
+
+```go
+e.Use(echojwt.WithConfig(echojwt.Config{
+ SigningKey: []byte("secret"),
+}))
+```
+
+## Configuración
+
+
+
+## Ejemplo
+
+Consulta el [recetario de JWT](/es/cookbook/jwt/) para ver un ejemplo completo.
diff --git a/site/src/content/docs/es/middleware/key-auth.md b/site/src/content/docs/es/middleware/key-auth.md
deleted file mode 100644
index 6d2da984..00000000
--- a/site/src/content/docs/es/middleware/key-auth.md
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: Key Auth
-description: Middleware de autenticación basada en clave que valida una API key desde header, query, form o cookie.
-sidebar:
- order: 11
----
-
-El middleware Key Auth proporciona autenticación basada en clave.
-
-- Para una clave válida llama al siguiente handler.
-- Para una clave inválida, envía una response `401 Unauthorized`.
-- Para una clave ausente, envía una response `400 Bad Request`.
-
-Todo el middleware principal reside en el paquete `middleware`:
-
-```go
-import "github.com/labstack/echo/v5/middleware"
-```
-
-## Uso
-
-```go
-e.Use(middleware.KeyAuth(func(c *echo.Context, key string, source middleware.ExtractorSource) (bool, error) {
- return key == "valid-key", nil
-}))
-```
-
-## Configuración personalizada
-
-```go
-e := echo.New()
-e.Use(middleware.KeyAuthWithConfig(middleware.KeyAuthConfig{
- KeyLookup: "query:api-key",
- Validator: func(c *echo.Context, key string, source middleware.ExtractorSource) (bool, error) {
- return key == "valid-key", nil
- },
-}))
-```
-
-## Configuración
-
-```go
-type KeyAuthConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // KeyLookup is a string in the form ":" or
- // ":,:" used to extract the key from the request.
- // Optional. Default value "header:Authorization:Bearer ".
- // Possible values:
- // - "header:" or "header::"
- // trims a static prefix from the extracted value. For
- // `Authorization: Basic `, the prefix to remove is `Basic `.
- // - "query:"
- // - "form:"
- // - "cookie:"
- // Multiple sources example: "header:Authorization,header:X-Api-Key".
- KeyLookup string
-
- // AllowedCheckLimit sets how many KeyLookup values are allowed to be checked. This is
- // useful in environments such as corporate test setups with application proxies
- // restricting access with their own auth scheme.
- AllowedCheckLimit uint
-
- // Validator validates the key.
- // Required.
- Validator KeyAuthValidator
-
- // ErrorHandler defines a function executed when all lookups have been done and none
- // passed the Validator. It runs with the last missing (ErrExtractionValueMissing) or
- // invalid key, and may be used to define a custom error.
- //
- // Note: when the error handler swallows the error (returns nil), the middleware
- // continues the handler chain. This is useful when part of your site/api is public
- // and offers extra features for authorized users.
- ErrorHandler KeyAuthErrorHandler
-
- // ContinueOnIgnoredError allows the next middleware/handler to be called when the
- // ErrorHandler ignores the error (returns nil).
- ContinueOnIgnoredError bool
-}
-```
-
-`Validator` tiene esta firma:
-
-```go
-type KeyAuthValidator func(c *echo.Context, key string, source ExtractorSource) (bool, error)
-```
-
-### Configuración por defecto
-
-```go
-DefaultKeyAuthConfig = KeyAuthConfig{
- Skipper: DefaultSkipper,
- KeyLookup: "header:" + echo.HeaderAuthorization + ":Bearer ",
-}
-```
diff --git a/site/src/content/docs/es/middleware/key-auth.mdx b/site/src/content/docs/es/middleware/key-auth.mdx
new file mode 100644
index 00000000..ae3adb58
--- /dev/null
+++ b/site/src/content/docs/es/middleware/key-auth.mdx
@@ -0,0 +1,59 @@
+---
+title: Key Auth
+description: Middleware de autenticación basada en clave que valida una API key desde header, query, form o cookie.
+sidebar:
+ order: 11
+---
+
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
+El middleware Key Auth proporciona autenticación basada en clave.
+
+- Para una clave válida llama al siguiente handler.
+- Para una clave inválida, envía una response `401 Unauthorized`.
+- Para una clave ausente, envía una response `400 Bad Request`.
+
+Todo el middleware principal reside en el paquete `middleware`:
+
+```go
+import "github.com/labstack/echo/v5/middleware"
+```
+
+## Uso
+
+```go
+e.Use(middleware.KeyAuth(func(c *echo.Context, key string, source middleware.ExtractorSource) (bool, error) {
+ return key == "valid-key", nil
+}))
+```
+
+## Configuración personalizada
+
+```go
+e := echo.New()
+e.Use(middleware.KeyAuthWithConfig(middleware.KeyAuthConfig{
+ KeyLookup: "query:api-key",
+ Validator: func(c *echo.Context, key string, source middleware.ExtractorSource) (bool, error) {
+ return key == "valid-key", nil
+ },
+}))
+```
+
+## Configuración
+
+
+
+`Validator` tiene esta firma:
+
+```go
+type KeyAuthValidator func(c *echo.Context, key string, source ExtractorSource) (bool, error)
+```
+
+### Configuración por defecto
+
+```go
+DefaultKeyAuthConfig = KeyAuthConfig{
+ Skipper: DefaultSkipper,
+ KeyLookup: "header:" + echo.HeaderAuthorization + ":Bearer ",
+}
+```
diff --git a/site/src/content/docs/es/middleware/logger.md b/site/src/content/docs/es/middleware/logger.md
deleted file mode 100644
index 25fb0640..00000000
--- a/site/src/content/docs/es/middleware/logger.md
+++ /dev/null
@@ -1,242 +0,0 @@
----
-title: Request Logger
-description: Logging de requests totalmente personalizable que se integra con bibliotecas de logging estructurado.
-sidebar:
- order: 12
----
-
-El middleware `RequestLogger` registra información sobre cada request HTTP. Te permite
-personalizar por completo qué se registra y cómo, por lo que encaja bien con bibliotecas
-de terceros de logging estructurado.
-
-Los valores que el logger puede extraer se controlan con los campos booleanos y slices de
-`RequestLoggerConfig`. Habilita un campo (por ejemplo `LogStatus: true`) para que su valor
-se rellene en `RequestLoggerValues`, que se pasa a tu `LogValuesFunc`.
-
-```go
-type RequestLoggerConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // BeforeNextFunc is called before the next middleware or handler in the chain.
- BeforeNextFunc func(c *echo.Context)
-
- // LogValuesFunc is called with the values extracted by the logger from the
- // request/response.
- // Mandatory.
- LogValuesFunc func(c *echo.Context, v RequestLoggerValues) error
-
- // HandleError instructs the logger to call the global error handler when the next
- // middleware/handler returns an error. A side effect is that the response is then
- // committed and sent, so middlewares up the chain can no longer change the status
- // code or body.
- HandleError bool
-
- // LogLatency records the duration of the rest of the handler chain (the next(c) call).
- LogLatency bool
- // LogProtocol extracts the request protocol (for example HTTP/1.1 or HTTP/2).
- LogProtocol bool
- // LogRemoteIP extracts the request remote IP. See echo.Context.RealIP() for details.
- LogRemoteIP bool
- // LogHost extracts the request host value (for example example.com).
- LogHost bool
- // LogMethod extracts the request method (for example GET).
- LogMethod bool
- // LogURI extracts the request URI (for example /list?lang=en&page=1).
- LogURI bool
- // LogURIPath extracts the request URI path part (for example /list).
- LogURIPath bool
- // LogRoutePath extracts the route path the request matched (for example /user/:id).
- LogRoutePath bool
- // LogRequestID extracts the request ID from the X-Request-ID request header, or the
- // response if the request did not have a value.
- LogRequestID bool
- // LogReferer extracts the request referer value.
- LogReferer bool
- // LogUserAgent extracts the request user agent value.
- LogUserAgent bool
- // LogStatus extracts the response status code. If the chain returns an echo.HTTPError,
- // the status code is taken from it.
- LogStatus bool
- // LogError extracts the error returned from the handler chain.
- LogError bool
- // LogContentLength extracts the Content-Length header value. Note: this can differ
- // from the actual request body size as it may be spoofed.
- LogContentLength bool
- // LogResponseSize extracts the response content length. Note: when used with Gzip
- // middleware this value may not always be correct.
- LogResponseSize bool
- // LogHeaders extracts the given list of request headers. A slice of values is logged
- // per header since a request can contain more than one. Names are canonicalized with
- // http.CanonicalHeaderKey (for example "accept-encoding" becomes "Accept-Encoding").
- LogHeaders []string
- // LogQueryParams extracts the given list of query parameters from the request URI. A
- // slice of values is logged per name since a request can repeat a parameter.
- LogQueryParams []string
- // LogFormValues extracts the given list of form values from the request body and URI.
- // A slice of values is logged per name since a request can repeat a value.
- LogFormValues []string
-}
-```
-
-Todo el middleware principal reside en el paquete `middleware`:
-
-```go
-import "github.com/labstack/echo/v5/middleware"
-```
-
-## Ejemplos
-
-### fmt.Printf
-
-```go
-skipper := func(c *echo.Context) bool {
- // Skip the health check endpoint.
- return c.Request().URL.Path == "/health"
-}
-e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
- LogStatus: true,
- LogURI: true,
- Skipper: skipper,
- BeforeNextFunc: func(c *echo.Context) {
- c.Set("customValueFromContext", 42)
- },
- LogValuesFunc: func(c *echo.Context, v middleware.RequestLoggerValues) error {
- value, _ := c.Get("customValueFromContext").(int)
- fmt.Printf("REQUEST: uri: %v, status: %v, custom-value: %v\n", v.URI, v.Status, value)
- return nil
- },
-}))
-```
-
-Salida de ejemplo:
-
-```text
-REQUEST: uri: /hello, status: 200, custom-value: 42
-```
-
-### slog ([log/slog](https://pkg.go.dev/log/slog))
-
-```go
-logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
-e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
- LogStatus: true,
- LogURI: true,
- LogError: true,
- HandleError: true, // forwards the error to the global error handler so it can pick the status code
- LogValuesFunc: func(c *echo.Context, v middleware.RequestLoggerValues) error {
- if v.Error == nil {
- logger.LogAttrs(context.Background(), slog.LevelInfo, "REQUEST",
- slog.String("uri", v.URI),
- slog.Int("status", v.Status),
- )
- } else {
- logger.LogAttrs(context.Background(), slog.LevelError, "REQUEST_ERROR",
- slog.String("uri", v.URI),
- slog.Int("status", v.Status),
- slog.String("err", v.Error.Error()),
- )
- }
- return nil
- },
-}))
-```
-
-Salida de ejemplo:
-
-```text
-{"time":"2024-12-30T20:55:46.2399999+08:00","level":"INFO","msg":"REQUEST","uri":"/hello","status":200}
-```
-
-### Zerolog ([rs/zerolog](https://github.com/rs/zerolog))
-
-```go
-logger := zerolog.New(os.Stdout)
-e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
- LogURI: true,
- LogStatus: true,
- LogValuesFunc: func(c *echo.Context, v middleware.RequestLoggerValues) error {
- logger.Info().
- Str("URI", v.URI).
- Int("status", v.Status).
- Msg("request")
- return nil
- },
-}))
-```
-
-Salida de ejemplo:
-
-```text
-{"level":"info","URI":"/hello","status":200,"message":"request"}
-```
-
-### Zap ([uber-go/zap](https://github.com/uber-go/zap))
-
-```go
-logger, _ := zap.NewProduction()
-e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
- LogURI: true,
- LogStatus: true,
- LogValuesFunc: func(c *echo.Context, v middleware.RequestLoggerValues) error {
- logger.Info("request",
- zap.String("URI", v.URI),
- zap.Int("status", v.Status),
- )
- return nil
- },
-}))
-```
-
-Salida de ejemplo:
-
-```text
-{"level":"info","ts":1735564026.3197417,"caller":"cmd/main.go:20","msg":"request","URI":"/hello","status":200}
-```
-
-### Logrus ([sirupsen/logrus](https://github.com/sirupsen/logrus))
-
-```go
-log := logrus.New()
-e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
- LogURI: true,
- LogStatus: true,
- LogValuesFunc: func(c *echo.Context, values middleware.RequestLoggerValues) error {
- log.WithFields(logrus.Fields{
- "URI": values.URI,
- "status": values.Status,
- }).Info("request")
- return nil
- },
-}))
-```
-
-Salida de ejemplo:
-
-```text
-time="2024-12-30T21:08:49+08:00" level=info msg=request URI=/hello status=200
-```
-
-## Solución de problemas
-
-### panic: missing LogValuesFunc callback function for request logger middleware
-
-Este panic ocurre cuando el callback obligatorio `LogValuesFunc` se deja sin configurar.
-Define una función que coincida con la firma de `LogValuesFunc` y asígnala en la configuración:
-
-```go
-func logValues(c *echo.Context, v middleware.RequestLoggerValues) error {
- fmt.Printf("Request Method: %s, URI: %s\n", v.Method, v.URI)
- return nil
-}
-
-e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
- LogValuesFunc: logValues,
-}))
-```
-
-### Los parámetros en los logs están vacíos
-
-Si valores como `v.URI` y `v.Status` están vacíos dentro de `LogValuesFunc`, comprueba que los
-flags de extracción correspondientes (`LogStatus`, `LogURI`, etc.) estén establecidos en `true`
-en la configuración. Cada valor solo se rellena cuando su flag está habilitado.
diff --git a/site/src/content/docs/es/middleware/logger.mdx b/site/src/content/docs/es/middleware/logger.mdx
new file mode 100644
index 00000000..1c65a829
--- /dev/null
+++ b/site/src/content/docs/es/middleware/logger.mdx
@@ -0,0 +1,54 @@
+---
+title: Request Logger
+description: Registra valores seleccionados de la petición y la respuesta con tu biblioteca de logging.
+sidebar:
+ order: 12
+---
+
+import { Code } from '@astrojs/starlight/components';
+import ConfigReference from '../../../../components/ConfigReference.astro';
+import example from '../../../../generated/request-logger.go.txt?raw';
+
+`RequestLogger` entrega los valores seleccionados de la petición y la respuesta a la función obligatoria `LogValuesFunc`. Puedes usar `slog` u otra biblioteca. Cada campo `Log*` activa la extracción de un valor; por ejemplo, `LogStatus: true` rellena `v.Status`.
+
+## Ejemplos
+
+### slog ([log/slog](https://pkg.go.dev/log/slog))
+
+Este programa completo registra la URI y el estado como JSON. Desde el repositorio de `echox`, ejecuta `cd reference/request-logger && go run .` y solicita `http://localhost:1323/`.
+
+
+
+La página importa el mismo archivo que compila la CI de documentación. `v.Error` recibe el error devuelto por el siguiente handler. Con `HandleError: true`, el manejador global escribe la respuesta antes de ejecutar `LogValuesFunc`; los middleware anteriores ya no pueden cambiar el estado ni el cuerpo.
+
+### fmt.Printf
+
+En una aplicación pequeña, `LogValuesFunc` puede usar `fmt.Printf`. Activa los campos `Log*` de los valores que quieras leer.
+
+### Zerolog ([rs/zerolog](https://github.com/rs/zerolog))
+
+Pasa los valores seleccionados a Zerolog dentro de `LogValuesFunc`.
+
+### Zap ([uber-go/zap](https://github.com/uber-go/zap))
+
+Usa la misma función para enviar los valores a Zap.
+
+### Logrus ([sirupsen/logrus](https://github.com/sirupsen/logrus))
+
+Crea los campos de Logrus a partir de `RequestLoggerValues`.
+
+## Configuración
+
+La tabla se genera a partir de los campos exportados de la revisión indicada de Echo. No presupone valores predeterminados en tiempo de ejecución.
+
+
+
+## Solución de problemas
+
+### panic: missing LogValuesFunc callback function for request logger middleware
+
+`LogValuesFunc` es obligatoria. Asígnala antes de llamar a `RequestLoggerWithConfig`; el ejemplo ejecutable incluye esta función.
+
+### Los parámetros en los logs están vacíos
+
+Activa el campo de extracción correspondiente: `LogURI: true` para `v.URI` o `LogStatus: true` para `v.Status`.
diff --git a/site/src/content/docs/es/middleware/method-override.md b/site/src/content/docs/es/middleware/method-override.mdx
similarity index 77%
rename from site/src/content/docs/es/middleware/method-override.md
rename to site/src/content/docs/es/middleware/method-override.mdx
index aac8c37c..2bf06393 100644
--- a/site/src/content/docs/es/middleware/method-override.md
+++ b/site/src/content/docs/es/middleware/method-override.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 13
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Method Override lee el método sobrescrito desde el request y lo usa
en lugar del método original.
@@ -37,16 +39,7 @@ El método puede obtenerse con `MethodFromHeader`, `MethodFromForm` o `MethodFro
## Configuración
-```go
-type MethodOverrideConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Getter is a function that gets the overridden method from the request.
- // Optional. Default value MethodFromHeader(echo.HeaderXHTTPMethodOverride).
- Getter MethodOverrideGetter
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/open-telemetry.md b/site/src/content/docs/es/middleware/open-telemetry.mdx
similarity index 92%
rename from site/src/content/docs/es/middleware/open-telemetry.md
rename to site/src/content/docs/es/middleware/open-telemetry.mdx
index 4981e981..10572870 100644
--- a/site/src/content/docs/es/middleware/open-telemetry.md
+++ b/site/src/content/docs/es/middleware/open-telemetry.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 14
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
[Echo OpenTelemetry](https://github.com/labstack/echo-opentelemetry) es un middleware que
proporciona instrumentación OpenTelemetry para requests HTTP.
@@ -80,3 +82,7 @@ tracer, err := echo.ContextGet[trace.Tracer](c, echootel.TracerKey)
El [ejemplo](https://github.com/labstack/echo-opentelemetry/blob/main/example/main.go) exporta
metrics y spans a stdout, pero puedes usar cualquier exporter (OTLP, etc.). Consulta la
documentación de [OpenTelemetry exporters](https://opentelemetry.io/docs/languages/go/exporters).
+
+## Referencia de la API
+
+
diff --git a/site/src/content/docs/es/middleware/prometheus.md b/site/src/content/docs/es/middleware/prometheus.mdx
similarity index 96%
rename from site/src/content/docs/es/middleware/prometheus.md
rename to site/src/content/docs/es/middleware/prometheus.mdx
index 88398857..1f40da1f 100644
--- a/site/src/content/docs/es/middleware/prometheus.md
+++ b/site/src/content/docs/es/middleware/prometheus.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 15
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware [Echo Prometheus](https://github.com/labstack/echo-prometheus) genera metrics
Prometheus para requests HTTP.
@@ -282,3 +284,11 @@ func main() {
}
}
```
+
+## Referencia de la API
+
+
+
+
+
+
diff --git a/site/src/content/docs/es/middleware/proxy.md b/site/src/content/docs/es/middleware/proxy.md
deleted file mode 100644
index 44ec44b8..00000000
--- a/site/src/content/docs/es/middleware/proxy.md
+++ /dev/null
@@ -1,140 +0,0 @@
----
-title: Proxy
-description: Middleware de reverse proxy HTTP y WebSocket con load balancing.
-sidebar:
- order: 16
----
-
-Proxy proporciona un middleware de reverse proxy HTTP/WebSocket. Reenvía un request a un
-servidor upstream usando una técnica de load balancing configurada.
-
-Todo el middleware principal reside en el paquete `middleware`:
-
-```go
-import "github.com/labstack/echo/v5/middleware"
-```
-
-## Uso
-
-```go
-url1, err := url.Parse("http://localhost:8081")
-if err != nil {
- e.Logger.Error("failed to parse url", "error", err)
-}
-url2, err := url.Parse("http://localhost:8082")
-if err != nil {
- e.Logger.Error("failed to parse url", "error", err)
-}
-e.Use(middleware.Proxy(middleware.NewRoundRobinBalancer([]*middleware.ProxyTarget{
- {
- URL: url1,
- },
- {
- URL: url2,
- },
-})))
-```
-
-## Configuración personalizada
-
-```go
-e := echo.New()
-e.Use(middleware.ProxyWithConfig(middleware.ProxyConfig{}))
-```
-
-## Configuración
-
-```go
-type ProxyConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Balancer defines a load balancing technique.
- // Required.
- Balancer ProxyBalancer
-
- // RetryCount defines the number of times a failed proxied request should be retried
- // using the next available ProxyTarget. Defaults to 0, meaning requests are never retried.
- RetryCount int
-
- // RetryFilter defines a function used to determine if a failed request to a
- // ProxyTarget should be retried. The RetryFilter will only be called when the number
- // of previous retries is less than RetryCount. If the function returns true, the
- // request will be retried. The provided error indicates the reason for the request
- // failure. When the ProxyTarget is unavailable, the error will be an instance of
- // echo.HTTPError with a code of http.StatusBadGateway. In all other cases, the error
- // will indicate an internal error in the Proxy middleware. When a RetryFilter is not
- // specified, all requests that fail with http.StatusBadGateway will be retried. A custom
- // RetryFilter can be provided to only retry specific requests. Note that RetryFilter is
- // only called when the request to the target fails, or an internal error in the Proxy
- // middleware has occurred. Successful requests that return a non-200 response code cannot
- // be retried.
- RetryFilter func(c *echo.Context, e error) bool
-
- // ErrorHandler defines a function which can be used to return custom errors from
- // the Proxy middleware. ErrorHandler is only invoked when there has been
- // either an internal error in the Proxy middleware or the ProxyTarget is
- // unavailable. Due to the way requests are proxied, ErrorHandler is not invoked
- // when a ProxyTarget returns a non-200 response. In these cases, the response
- // is already written so errors cannot be modified. ErrorHandler is only
- // invoked after all retry attempts have been exhausted.
- ErrorHandler func(c *echo.Context, err error) error
-
- // Rewrite defines URL path rewrite rules. The values captured in asterisk can be
- // retrieved by index e.g. $1, $2 and so on.
- // Examples:
- // "/old": "/new",
- // "/api/*": "/$1",
- // "/js/*": "/public/javascripts/$1",
- // "/users/*/orders/*": "/user/$1/order/$2",
- Rewrite map[string]string
-
- // RegexRewrite defines rewrite rules using regexp.Regexp with captures.
- // Every capture group in the values can be retrieved by index e.g. $1, $2 and so on.
- // Example:
- // "^/old/[0.9]+/": "/new",
- // "^/api/.+?/(.*)": "/v2/$1",
- RegexRewrite map[*regexp.Regexp]string
-
- // Context key to store selected ProxyTarget into context.
- // Optional. Default value "target".
- ContextKey string
-
- // To customize the transport to remote.
- // Examples: If custom TLS certificates are required.
- Transport http.RoundTripper
-
- // ModifyResponse defines function to modify response from ProxyTarget.
- ModifyResponse func(*http.Response) error
-}
-```
-
-### Configuración por defecto
-
-| Nombre | Valor |
-| ---------- | -------------- |
-| Skipper | DefaultSkipper |
-| ContextKey | `target` |
-
-### Reglas basadas en regex
-
-Para rewriting avanzado de requests proxied, también se pueden definir reglas usando
-expresiones regulares. Los grupos de captura normales se pueden definir con `()` y referenciar
-por índice (`$1`, `$2`, ...) en el path reescrito.
-
-Las reglas `RegexRewrite` y `Rewrite` normales se pueden combinar.
-
-```go
-e.Use(middleware.ProxyWithConfig(middleware.ProxyConfig{
- Balancer: rrb,
- Rewrite: map[string]string{
- "^/v1/*": "/v2/$1",
- },
- RegexRewrite: map[*regexp.Regexp]string{
- regexp.MustCompile("^/foo/([0-9].*)"): "/num/$1",
- regexp.MustCompile("^/bar/(.+?)/(.*)"): "/baz/$2/$1",
- },
-}))
-```
-
-Consulta el recetario de [reverse proxy](/es/cookbook/reverse-proxy/) para ver un ejemplo completo.
diff --git a/site/src/content/docs/es/middleware/proxy.mdx b/site/src/content/docs/es/middleware/proxy.mdx
new file mode 100644
index 00000000..3fd867cd
--- /dev/null
+++ b/site/src/content/docs/es/middleware/proxy.mdx
@@ -0,0 +1,79 @@
+---
+title: Proxy
+description: Middleware de reverse proxy HTTP y WebSocket con load balancing.
+sidebar:
+ order: 16
+---
+
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
+Proxy proporciona un middleware de reverse proxy HTTP/WebSocket. Reenvía un request a un
+servidor upstream usando una técnica de load balancing configurada.
+
+Todo el middleware principal reside en el paquete `middleware`:
+
+```go
+import "github.com/labstack/echo/v5/middleware"
+```
+
+## Uso
+
+```go
+url1, err := url.Parse("http://localhost:8081")
+if err != nil {
+ e.Logger.Error("failed to parse url", "error", err)
+}
+url2, err := url.Parse("http://localhost:8082")
+if err != nil {
+ e.Logger.Error("failed to parse url", "error", err)
+}
+e.Use(middleware.Proxy(middleware.NewRoundRobinBalancer([]*middleware.ProxyTarget{
+ {
+ URL: url1,
+ },
+ {
+ URL: url2,
+ },
+})))
+```
+
+## Configuración personalizada
+
+```go
+e := echo.New()
+e.Use(middleware.ProxyWithConfig(middleware.ProxyConfig{}))
+```
+
+## Configuración
+
+
+
+### Configuración por defecto
+
+| Nombre | Valor |
+| ---------- | -------------- |
+| Skipper | DefaultSkipper |
+| ContextKey | `target` |
+
+### Reglas basadas en regex
+
+Para rewriting avanzado de requests proxied, también se pueden definir reglas usando
+expresiones regulares. Los grupos de captura normales se pueden definir con `()` y referenciar
+por índice (`$1`, `$2`, ...) en el path reescrito.
+
+Las reglas `RegexRewrite` y `Rewrite` normales se pueden combinar.
+
+```go
+e.Use(middleware.ProxyWithConfig(middleware.ProxyConfig{
+ Balancer: rrb,
+ Rewrite: map[string]string{
+ "^/v1/*": "/v2/$1",
+ },
+ RegexRewrite: map[*regexp.Regexp]string{
+ regexp.MustCompile("^/foo/([0-9].*)"): "/num/$1",
+ regexp.MustCompile("^/bar/(.+?)/(.*)"): "/baz/$2/$1",
+ },
+}))
+```
+
+Consulta el recetario de [reverse proxy](/es/cookbook/reverse-proxy/) para ver un ejemplo completo.
diff --git a/site/src/content/docs/es/middleware/rate-limiter.md b/site/src/content/docs/es/middleware/rate-limiter.mdx
similarity index 83%
rename from site/src/content/docs/es/middleware/rate-limiter.md
rename to site/src/content/docs/es/middleware/rate-limiter.mdx
index f815d41b..5c0dfd31 100644
--- a/site/src/content/docs/es/middleware/rate-limiter.md
+++ b/site/src/content/docs/es/middleware/rate-limiter.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 17
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
`RateLimiter` proporciona un middleware de rate limiter que limita el número de requests enviados
al servidor desde una IP o identificador particular dentro de un periodo.
@@ -72,20 +74,9 @@ Para implementar tu propio store, satisface la interfaz `RateLimiterStore` y pá
## Configuración
-```go
-type RateLimiterConfig struct {
- Skipper Skipper
- BeforeFunc BeforeFunc
- // IdentifierExtractor uses echo.Context to extract the identifier for a visitor.
- IdentifierExtractor Extractor
- // Store defines a store for the rate limiter.
- Store RateLimiterStore
- // ErrorHandler provides a handler to be called when IdentifierExtractor returns a non-nil error.
- ErrorHandler func(c *echo.Context, err error) error
- // DenyHandler provides a handler to be called when RateLimiter denies access.
- DenyHandler func(c *echo.Context, identifier string, err error) error
-}
-```
+
+
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/recover.md b/site/src/content/docs/es/middleware/recover.mdx
similarity index 67%
rename from site/src/content/docs/es/middleware/recover.md
rename to site/src/content/docs/es/middleware/recover.mdx
index fee2951c..29c53d89 100644
--- a/site/src/content/docs/es/middleware/recover.md
+++ b/site/src/content/docs/es/middleware/recover.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 18
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Recover se recupera de panics en cualquier punto de la cadena, imprime el stack trace y
pasa el control al
[HTTPErrorHandler](/es/guide/customization/#http-error-handler) centralizado.
@@ -35,25 +37,7 @@ El ejemplo anterior usa un `StackSize` de 1 KB y valores por defecto para `Disab
## Configuración
-```go
-type RecoverConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Size of the stack to be printed.
- // Optional. Default value 4KB.
- StackSize int
-
- // DisableStackAll disables formatting stack traces of all other goroutines
- // into the buffer after the trace for the current goroutine.
- // Optional. Default value false.
- DisableStackAll bool
-
- // DisablePrintStack disables printing the stack trace.
- // Optional. Default value false.
- DisablePrintStack bool
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/redirect.md b/site/src/content/docs/es/middleware/redirect.mdx
similarity index 88%
rename from site/src/content/docs/es/middleware/redirect.md
rename to site/src/content/docs/es/middleware/redirect.mdx
index df641fc0..daab0e66 100644
--- a/site/src/content/docs/es/middleware/redirect.md
+++ b/site/src/content/docs/es/middleware/redirect.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 19
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
Todo el middleware principal reside en el paquete `middleware`:
```go
@@ -85,16 +87,7 @@ El ejemplo anterior redirige requests HTTP a HTTPS con el código de estado
## Configuración
-```go
-type RedirectConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Status code to be used when redirecting the request.
- // Optional. Default value http.StatusMovedPermanently.
- Code int
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/request-id.md b/site/src/content/docs/es/middleware/request-id.mdx
similarity index 75%
rename from site/src/content/docs/es/middleware/request-id.md
rename to site/src/content/docs/es/middleware/request-id.mdx
index 64b41732..345a52f4 100644
--- a/site/src/content/docs/es/middleware/request-id.md
+++ b/site/src/content/docs/es/middleware/request-id.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 20
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Request ID genera un ID único para un request.
Todo el middleware principal reside en el paquete `middleware`:
@@ -49,23 +51,7 @@ e.Use(middleware.RequestIDWithConfig(middleware.RequestIDConfig{
## Configuración
-```go
-type RequestIDConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Generator defines a function to generate an ID.
- // Optional. Default value random.String(32).
- Generator func() string
-
- // RequestIDHandler defines a function which is executed for a request id.
- RequestIDHandler func(c *echo.Context, requestID string)
-
- // TargetHeader defines what header to look for to populate the id.
- // Optional. Default value is `X-Request-Id`.
- TargetHeader string
-}
-```
+
### Configuración por defecto
diff --git a/site/src/content/docs/es/middleware/rewrite.md b/site/src/content/docs/es/middleware/rewrite.mdx
similarity index 71%
rename from site/src/content/docs/es/middleware/rewrite.md
rename to site/src/content/docs/es/middleware/rewrite.mdx
index dc3d86b4..61d79b5e 100644
--- a/site/src/content/docs/es/middleware/rewrite.md
+++ b/site/src/content/docs/es/middleware/rewrite.mdx
@@ -5,6 +5,8 @@ sidebar:
order: 21
---
+import ConfigReference from '../../../../components/ConfigReference.astro';
+
El middleware Rewrite reescribe el path de la URL según las reglas proporcionadas. Es útil para
compatibilidad hacia atrás o para crear enlaces más limpios y descriptivos.
@@ -42,29 +44,7 @@ e.Pre(middleware.RewriteWithConfig(middleware.RewriteConfig{}))
## Configuración
-```go
-type RewriteConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // Rules defines the URL path rewrite rules. The values captured in asterisk can be
- // retrieved by index e.g. $1, $2 and so on.
- // Example:
- // "/old": "/new",
- // "/api/*": "/$1",
- // "/js/*": "/public/javascripts/$1",
- // "/users/*/orders/*": "/user/$1/order/$2",
- // Required.
- Rules map[string]string
-
- // RegexRules defines the URL path rewrite rules using regexp.Regexp with captures.
- // Every capture group in the values can be retrieved by index e.g. $1, $2 and so on.
- // Example:
- // "^/old/[0.9]+/": "/new",
- // "^/api/.+?/(.*)": "/v2/$1",
- RegexRules map[*regexp.Regexp]string
-}
-```
+
Configuración por defecto:
diff --git a/site/src/content/docs/es/middleware/secure.md b/site/src/content/docs/es/middleware/secure.md
deleted file mode 100644
index 53a1a1b8..00000000
--- a/site/src/content/docs/es/middleware/secure.md
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: Secure
-description: Protege contra XSS, content sniffing, clickjacking y otros ataques de inyección.
-sidebar:
- order: 22
----
-
-El middleware Secure proporciona protección contra cross-site scripting (XSS), content type
-sniffing, clickjacking, conexiones inseguras y otros ataques de inyección de código.
-
-Todo el middleware principal reside en el paquete `middleware`:
-
-```go
-import "github.com/labstack/echo/v5/middleware"
-```
-
-## Uso
-
-```go
-e.Use(middleware.Secure())
-```
-
-## Configuración personalizada
-
-```go
-e := echo.New()
-e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
- XSSProtection: "",
- ContentTypeNosniff: "",
- XFrameOptions: "",
- HSTSMaxAge: 3600,
- ContentSecurityPolicy: "default-src 'self'",
-}))
-```
-
-:::note
-Pasar un `XSSProtection`, `ContentTypeNosniff`, `XFrameOptions` o
-`ContentSecurityPolicy` vacío deshabilita esa protección.
-:::
-
-## Configuración
-
-```go
-type SecureConfig struct {
- // Skipper defines a function to skip middleware.
- Skipper Skipper
-
- // XSSProtection provides protection against cross-site scripting attack (XSS)
- // by setting the `X-XSS-Protection` header.
- // Optional. Default value "1; mode=block".
- XSSProtection string
-
- // ContentTypeNosniff provides protection against overriding Content-Type
- // header by setting the `X-Content-Type-Options` header.
- // Optional. Default value "nosniff".
- ContentTypeNosniff string
-
- // XFrameOptions can be used to indicate whether or not a browser should
- // be allowed to render a page in a ,