mirror of
https://github.com/labstack/echo.git
synced 2024-11-28 08:38:39 +02:00
parent
b2c623b07d
commit
80d5c96212
@ -15,7 +15,6 @@
|
|||||||
- Highly customizable
|
- Highly customizable
|
||||||
- Automatic TLS via Let’s Encrypt
|
- Automatic TLS via Let’s Encrypt
|
||||||
- HTTP/2 support
|
- HTTP/2 support
|
||||||
- Built-in graceful shutdown
|
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ a custom logger using `Echo#Logger`.
|
|||||||
|
|
||||||
## Custom Server
|
## Custom Server
|
||||||
|
|
||||||
### Using `Echo#StartServer()`
|
`Echo#StartServer()` can be used to run a custom server.
|
||||||
|
|
||||||
*Example*
|
*Example*
|
||||||
|
|
||||||
@ -52,25 +52,6 @@ s := &http.Server{
|
|||||||
e.Logger.Fatal(e.StartServer(s))
|
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
|
## Disable HTTP/2
|
||||||
|
|
||||||
`Echo#DisableHTTP2` can be used disable HTTP/2 protocol.
|
`Echo#DisableHTTP2` can be used disable HTTP/2 protocol.
|
||||||
|
Loading…
Reference in New Issue
Block a user