1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-01 22:51:17 +02:00

Merge pull request #61 from labstack/middleware

Middleware
This commit is contained in:
Vishal Rana
2015-05-15 16:07:12 -07:00
16 changed files with 138 additions and 42 deletions

View File

@@ -163,9 +163,9 @@ h := func(*echo.Context) *HTTPError {
e.Get("/users/:id", h)
```
## (Middleware)[https://github.com/labstack/echo/tree/master/examples/middleware]
## Middleware
*WIP*
[*WIP*](https://github.com/labstack/echo/tree/master/examples/middleware)
## Response

View File

@@ -66,7 +66,7 @@ func main() {
e := echo.New()
// Middleware
e.Use(mw.Logger)
e.Use(mw.Logger())
// Routes
e.Get("/", hello)
@@ -78,7 +78,7 @@ func main() {
`echo.New()` returns a new instance of Echo.
`e.Use(mw.Logger)` adds logging middleware to the chain. It logs every HTTP request
`e.Use(mw.Logger())` adds logging middleware to the chain. It logs every HTTP request
made to the server, producing output
```sh