1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-22 20:06:21 +02:00
echo/recipe/graceful-shutdown/server.go
Antonio Pagano ffdb76efc7 [doc] adding graceful documentation and example. (#688)
* [doc] adding graceful documentation and example.

* adding myself to the maintainers list and minor comment formatting change
2016-10-25 08:09:43 -07:00

23 lines
336 B
Go

package main
import (
"time"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
// Setting up the termination timeout to 30 seconds.
e.ShutdownTimeout = 30 * time.Second
e.GET("/", func(ctx echo.Context) error {
return ctx.String(200, "OK")
})
if err := e.Start(":1323"); err != nil {
e.Logger.Fatal(err)
}
}