aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2018-10-20 13:34:44 -0700
committerChristine Dodrill <me@christine.website>2018-10-20 13:34:44 -0700
commitb7493881049aaa908de04837d004ec5cf2d91b90 (patch)
tree01f2ffa0dcedfb77cf8ff33a4f0d1ed69b7b1860 /cmd
parentdf2301f496ce0bd81bc8967fb27d49f7c76fe948 (diff)
downloadxesite-b7493881049aaa908de04837d004ec5cf2d91b90.tar.xz
xesite-b7493881049aaa908de04837d004ec5cf2d91b90.zip
fix service worker
Diffstat (limited to 'cmd')
-rw-r--r--cmd/site/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/site/main.go b/cmd/site/main.go
index 4295e8a..e9b4d21 100644
--- a/cmd/site/main.go
+++ b/cmd/site/main.go
@@ -17,7 +17,7 @@ import (
"github.com/gorilla/feeds"
blackfriday "github.com/russross/blackfriday"
"github.com/tj/front"
- "gopkg.in/segmentio/analytics-go.v3"
+ analytics "gopkg.in/segmentio/analytics-go.v3"
)
var port = os.Getenv("PORT")
@@ -191,6 +191,9 @@ func Build() (*Site, error) {
s.mux.HandleFunc("/blog/", s.showPost)
s.mux.Handle("/css/", http.FileServer(http.Dir(".")))
s.mux.Handle("/static/", http.FileServer(http.Dir(".")))
+ s.mux.HandleFunc("/sw.js", func(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "./static/js/sw.js")
+ })
return s, nil
}