iris/graceful/README.md
2016-05-30 17:08:09 +03:00

373 B

Package information

Enables graceful shutdown.

Usage

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)
}