diff --git a/examples/favicon/favicon.ico b/examples/favicon/favicon.ico new file mode 100644 index 00000000..3959cd7f Binary files /dev/null and b/examples/favicon/favicon.ico differ diff --git a/examples/favicon/main.go b/examples/favicon/main.go new file mode 100644 index 00000000..5ad39331 --- /dev/null +++ b/examples/favicon/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "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(200, "Hello favicon.") + }) + app.Run(":8080") +}