Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 404 Bytes

package-graceful.md

File metadata and controls

28 lines (18 loc) · 404 Bytes

Graceful

This is a package

Enables graceful shutdown.

package main

import (
	"time"
    "github.com/kataras/iris"
	"github.com/kataras/iris/graceful"
)

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