https://github.com/go-http-utils/favicon
:stars:Go http middleware for serving the favicon
https://github.com/go-http-utils/favicon
Last synced: 5 months ago
JSON representation
:stars:Go http middleware for serving the favicon
- Host: GitHub
- URL: https://github.com/go-http-utils/favicon
- Owner: go-http-utils
- License: mit
- Created: 2016-11-26T08:17:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-26T13:59:53.000Z (over 9 years ago)
- Last Synced: 2024-06-20T13:37:36.728Z (about 2 years ago)
- Language: Go
- Homepage: https://godoc.org/github.com/go-http-utils/favicon
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# favicon
[](https://travis-ci.org/go-http-utils/favicon)
[](https://coveralls.io/github/go-http-utils/favicon?branch=master)
Go http middleware for serving the favicon.
## Installation
```
go get -u github.com/go-http-utils/favicon
```
## Documentation
API documentation can be found here: https://godoc.org/github.com/go-http-utils/favicon
## Usage
```go
import (
"github.com/go-http-utils/favicon"
)
```
```go
mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
res.Write([]byte("Hello World"))
})
http.ListenAndServe(":8080", favicon.Handler(mux, "./public/favicon.ico"))
```