- journal domain package - httpserver package - html templates - main.go in root dir
18 lines
312 B
Go
18 lines
312 B
Go
package httpserver
|
|
|
|
import "net/http"
|
|
|
|
type Favicon struct {
|
|
favicon []byte
|
|
}
|
|
|
|
func NewFavicon(favicon []byte) *Favicon {
|
|
return &Favicon{
|
|
favicon: favicon,
|
|
}
|
|
}
|
|
|
|
func (f *Favicon) FaviconHandler(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "image/x-icon")
|
|
w.Write(f.favicon)
|
|
}
|