diff --git a/go.mod b/go.mod index ce64477..05ac044 100644 --- a/go.mod +++ b/go.mod @@ -2,5 +2,7 @@ module github.com/swaggest/swgui require ( github.com/shurcooL/httpfs v0.0.0-20181222201310-74dc9339e414 // indirect + github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0 github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd + golang.org/x/tools v0.0.0-20190830172400-56125e7d709e // indirect ) diff --git a/go.sum b/go.sum index a6f4b6c..b1f3dd8 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,16 @@ github.com/shurcooL/httpfs v0.0.0-20181222201310-74dc9339e414 h1:IYVb70m/qpJGjyZV2S4qbdSDnsMl+w9nsQ2iQedf1HI= github.com/shurcooL/httpfs v0.0.0-20181222201310-74dc9339e414/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0 h1:mj/nMDAwTBiaCqMEs4cYCqF7pO6Np7vhy1D1wcQGz+E= +github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190830172400-56125e7d709e h1:jlbOw43fjYcUlLDKNNmKTeCQFyjkKEW/iUK7w7017XE= +golang.org/x/tools v0.0.0-20190830172400-56125e7d709e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/v2/handler.go b/v2/handler.go index 611dc1b..64d027b 100644 --- a/v2/handler.go +++ b/v2/handler.go @@ -5,10 +5,11 @@ import ( "html/template" "net/http" + "github.com/shurcooL/httpgzip" "github.com/swaggest/swgui" ) -var staticServer = http.FileServer(assets) +var staticServer = httpgzip.FileServer(assets, httpgzip.FileServerOptions{}) // Handler handle swagger UI request type Handler struct { diff --git a/v3/handler.go b/v3/handler.go index 676865e..83ab2da 100644 --- a/v3/handler.go +++ b/v3/handler.go @@ -5,10 +5,11 @@ import ( "html/template" "net/http" + "github.com/shurcooL/httpgzip" "github.com/swaggest/swgui" ) -var staticServer = http.FileServer(assets) +var staticServer = httpgzip.FileServer(assets, httpgzip.FileServerOptions{}) // Handler handle swagger UI request type Handler struct {