gin/examples/favicon/main.go

18 lines
283 B
Go
Raw Normal View History

2017-07-10 14:21:42 +00:00
package main
import (
"net/http"
2017-07-10 14:21:42 +00:00
"github.com/gin-gonic/gin"
"github.com/thinkerou/favicon"
)
func main() {
app := gin.Default()
app.Use(favicon.New("./favicon.ico"))
app.GET("/ping", func(c *gin.Context) {
c.String(http.StatusOK, "Hello favicon.")
2017-07-10 14:21:42 +00:00
})
app.Run(":8080")
}