compress files
This commit is contained in:
parent
438bcc5701
commit
805fdb13c1
3
main.go
3
main.go
@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"gitlab.com/zephyrtronium/sq"
|
||||
"nhooyr.io/websocket"
|
||||
|
||||
@ -54,7 +55,7 @@ func main() {
|
||||
r.Post("/user/login", s.Login)
|
||||
r.With(serve.WithSession(db)).Get("/user/me", s.Me)
|
||||
r.With(serve.WithSession(db)).Get("/queue", s.Queue)
|
||||
r.Method("GET", "/*", http.FileServer(http.Dir(public)))
|
||||
r.With(middleware.Compress(5, "text/html", "text/javascript", "text/css")).Method("GET", "/*", http.FileServer(http.Dir(public)))
|
||||
slog.Info("listening", "addr", addr, "public", public)
|
||||
http.ListenAndServe(addr, r)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user