1
0
mirror of https://github.com/labstack/echo.git synced 2025-02-07 13:31:38 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2017-01-04 11:39:28 -08:00
parent ee2ac3b9a2
commit c935874aa8

View File

@ -39,7 +39,7 @@ a custom logger using `Echo#Logger`.
## Custom Server
`Echo#StartServer()` can be used to run a custom `http.Server`.
### Using `Echo#StartServer()`
*Example*
@ -52,6 +52,25 @@ s := &http.Server{
e.Logger.Fatal(e.StartServer(s))
```
### Using `http.ListenAndServe*()`
*Example*
```go
e := echo.New()
e.GET("/", func(c echo.Context) error {
return c.JSON(http.StatusOK, "OK")
})
s := &http.Server{
Handler: e,
Addr: ":1323",
}
e.Logger.Fatal(s.ListenAndServe())
```
> This setup will bypass auto-tls and graceful shutdown.
## Disable HTTP/2
`Echo#DisableHTTP2` can be used disable HTTP/2 protocol.