diff --git a/server/src/handler/filehandler.go b/server/src/handler/filehandler.go index 168a942..45b5c0a 100644 --- a/server/src/handler/filehandler.go +++ b/server/src/handler/filehandler.go @@ -15,6 +15,14 @@ func FileHandler(w http.ResponseWriter, req *http.Request) { } uri = uri[1:] data, err := Resources.Asset(uri) + if err != nil && uri[len(uri)-1] != '/' { + // workaround for routes like "/play" which really should be "/play/index.html" + uriFolder := uri + "/index.html" + data, err = Resources.Asset(uriFolder) + if err == nil { + uri = uriFolder + } + } if err != nil { fmt.Printf("%s: %v\n", uri, err) http.NotFoundHandler().ServeHTTP(w, req) diff --git a/server/src/resources/dist-build.go b/server/src/resources/dist-build.go index 9cda25e..c4ec58a 100644 --- a/server/src/resources/dist-build.go +++ b/server/src/resources/dist-build.go @@ -1,3 +1,3 @@ package Resources -//go:generate go-bindata -pkg Resources -o dist-generated.go --prefix ../../../client/dist/ ../../../client/dist/ ../../../client/dist/_nuxt/ ../../../client/dist/play ../../../client/dist/admin ../../../client/dist/fonts/dosis ../../../client/dist/fonts/wendy-one +//go:generate go-bindata -pkg Resources -o dist-generated.go --prefix ../../../client/dist/ ../../../client/dist/ ../../../client/dist/_nuxt/ ../../../client/dist/play/ ../../../client/dist/admin/ ../../../client/dist/fonts/dosis ../../../client/dist/fonts/wendy-one