Skip to content

Commit

Permalink
Fixed routing for static assets
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrgrey committed Apr 29, 2020
1 parent edaadb8 commit 2be6a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/main.go
Expand Up @@ -36,10 +36,10 @@ func main() {
}

buildPath := path.Clean(cfg.BuildPath)
buildURL := fmt.Sprintf("/%s/", buildPath)
staticPath := path.Join(buildPath, "/static/")

mux := http.NewServeMux()
mux.Handle(buildURL, http.StripPrefix(buildURL, http.FileServer(http.Dir(buildPath))))
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(staticPath))))
mux.Handle("/api", api.Handler())
mux.Handle("/", server.Handler(buildPath))

Expand Down

0 comments on commit 2be6a46

Please sign in to comment.