mirror of
https://github.com/labstack/echo.git
synced 2025-04-23 12:18:53 +02:00
Middleware with options - 2
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
f5a385b547
commit
4f45cd1517
@ -31,6 +31,16 @@ func main() {
|
|||||||
return false
|
return false
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
//-------
|
||||||
|
// Slash
|
||||||
|
//-------
|
||||||
|
|
||||||
|
e.Use(mw.StripTrailingSlash())
|
||||||
|
|
||||||
|
// or
|
||||||
|
|
||||||
|
// e.Use(mw.RedirectToSlash())
|
||||||
|
|
||||||
// Routes
|
// Routes
|
||||||
e.Get("/", hello)
|
e.Get("/", hello)
|
||||||
|
|
||||||
|
@ -163,7 +163,9 @@ h := func(*echo.Context) *HTTPError {
|
|||||||
e.Get("/users/:id", h)
|
e.Get("/users/:id", h)
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- ## Middleware -->
|
## (Middleware)[https://github.com/labstack/echo/tree/master/examples/middleware]
|
||||||
|
|
||||||
|
*WIP*
|
||||||
|
|
||||||
## Response
|
## Response
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user