forked from mirror/gin
add favicon example (#1001)
This commit is contained in:
parent
e31cbdf241
commit
44da058aa0
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -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")
|
||||||
|
}
|
Loading…
Reference in New Issue