mirror of
https://github.com/Luzifer/gziphttp.git
synced 2024-09-19 00:13:00 +00:00
Properly set up handler, add logging
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
3ac99ed5e3
commit
e3ee2400dc
9
main.go
9
main.go
@ -41,6 +41,11 @@ func init() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.Handle("/", httphelper.GzipHandler(http.FileServer(http.Dir(cfg.ServeDir))))
|
||||
log.WithError(http.ListenAndServe(cfg.Listen, nil)).Error("HTTP server ended")
|
||||
http.Handle("/", http.FileServer(http.Dir(cfg.ServeDir)))
|
||||
|
||||
var handler http.Handler = http.DefaultServeMux
|
||||
handler = httphelper.GzipHandler(handler)
|
||||
handler = httphelper.NewHTTPLogHandler(handler)
|
||||
|
||||
log.WithError(http.ListenAndServe(cfg.Listen, handler)).Error("HTTP server ended")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user