journal/httpserver/favicon.go
Vojtěch Mareš 943922a6e1
feat: add app code
- journal domain package
- httpserver package
- html templates
- main.go in root dir
2025-04-22 22:01:53 +02:00

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)
}