1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-24 03:16:14 +02:00

Merge pull request #233 from mertenvg/fix/recipes-graceful

Fix/recipes graceful
This commit is contained in:
Vishal Rana 2015-10-12 10:33:21 -07:00
commit 79e2c1c07a
2 changed files with 11 additions and 2 deletions

View File

@ -14,5 +14,14 @@ func main() {
return c.String(http.StatusOK, "Six sick bricks tick")
})
gracehttp.Serve(e.Server(":1323"))
// Get the http.Server
s := e.Server(":1323")
// HTTP2 is currently enabled by default in echo.New(). To override TLS handshake errors
// you will need to override the TLSConfig for the server so it does not attempt to valudate
// the connection using TLS as required by HTTP2
s.TLSConfig = nil
// Serve it like a boss
gracehttp.Serve(s)
}

View File

@ -12,7 +12,7 @@ func main() {
// Setup
e := echo.New()
e.Get("/", func(c *echo.Context) error {
return c.String(http.StatusOK, "Sue sews rose on slow jor crows nose")
return c.String(http.StatusOK, "Sue sews rose on slow joe crows nose")
})
graceful.ListenAndServe(e.Server(":1323"), 5*time.Second)