Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thinkerou/favicon
Gin middleware to support favicon.
https://github.com/thinkerou/favicon
favicon gin middleware
Last synced: about 1 month ago
JSON representation
Gin middleware to support favicon.
- Host: GitHub
- URL: https://github.com/thinkerou/favicon
- Owner: thinkerou
- License: mit
- Created: 2017-07-10T13:46:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-24T06:16:48.000Z (over 1 year ago)
- Last Synced: 2024-09-28T18:20:32.325Z (about 2 months ago)
- Topics: favicon, gin, middleware
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 34
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Favicon Gin's middleware
Gin middleware to support favicon.
## Usage
### Start using it
Download and install it:
```sh
$ go get github.com/thinkerou/favicon
```Import it in your code:
```go
import "github.com/thinkerou/favicon"
```### Canonical example:
```go
package main
import (
"github.com/gin-gonic/gin"
"github.com/thinkerou/favicon"
)
func main() {
r := gin.Default()
r.Use(favicon.New("./favicon.ico")) // set favicon middlewarer.GET("/ping", func(c *gin.Context) {
c.String(200, "Hello favicon.")
})r.Run(":8080")
}
```