Skip to content

Commit dca53a6

Browse files
committed
Updated docs, fixed labstack/echo#994
Signed-off-by: Vishal Rana <[email protected]>
1 parent 807a9c7 commit dca53a6

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

website/content/guide/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To completely disable logs use `Echo#Logger.SetOutput(ioutil.Discard)` or `Echo#
2424
### Log Level
2525

2626
`Echo#Logger.SetLevel(log.Lvl)` can be used to set the log level for the logger.
27-
Default value is `OFF`. Possible values:
27+
Default value is `ERROR`. Possible values:
2828

2929
- `DEBUG`
3030
- `INFO`

website/content/guide/routing.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,13 @@ g.Use(middleware.BasicAuth(func(username, password string) bool {
9797
Each of the registration methods returns a `Route` object, which can be used to name a route after the registration. For example:
9898

9999
```go
100-
routeInfo := e.GET("/users/:id", func(c echo.Context) error {
101-
return c.String(http.StatusOK, "/users/:id")
100+
route := e.POST("/users", func(c echo.Context) error {
102101
})
103-
routeInfo.Name = "user"
102+
route.Name = "create-user"
104103

105104
// or using the inline syntax
106-
e.GET("/users/new", func(c echo.Context) error {
107-
return c.String(http.StatusOK, "/users/new")
108-
}).Name = "newuser"
105+
e.GET("/users/:id", func(c echo.Context) error {
106+
}).Name = "get-user"
109107
```
110108

111109
Route names can be very useful when generating URIs from the templates, where you can't access the handler references or when you have multiple routes with the same handler.
@@ -185,22 +183,22 @@ ioutil.WriteFile("routes.json", data, 0644)
185183
{
186184
"method": "POST",
187185
"path": "/users",
188-
"handler": "main.createUser"
186+
"name": "main.createUser"
189187
},
190188
{
191189
"method": "GET",
192190
"path": "/users",
193-
"handler": "main.findUser"
191+
"name": "main.findUser"
194192
},
195193
{
196194
"method": "PUT",
197195
"path": "/users",
198-
"handler": "main.updateUser"
196+
"name": "main.updateUser"
199197
},
200198
{
201199
"method": "DELETE",
202200
"path": "/users",
203-
"handler": "main.deleteUser"
201+
"name": "main.deleteUser"
204202
}
205203
]
206204
```

0 commit comments

Comments
 (0)