mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
26 lines
373 B
Markdown
26 lines
373 B
Markdown
## Package information
|
|
|
|
Enables graceful shutdown.
|
|
|
|
## Usage
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"github.com/kataras/iris/graceful"
|
|
"github.com/kataras/iris"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
api := iris.New()
|
|
api.Get("/", func(c *iris.Context) {
|
|
c.Write("Welcome to the home page!")
|
|
})
|
|
|
|
graceful.Run(":3001", time.Duration(10)*time.Second, api)
|
|
}
|
|
|
|
```
|