diff --git a/main.go b/main.go index caaaa4d..44b3c44 100644 --- a/main.go +++ b/main.go @@ -17,10 +17,11 @@ import ( //go:embed web/dist/* var staticFS embed.FS -// go embedは.(ピリオド)始まりのファイルに対応しない -// 一時的に除外する -///go:embed vMixMultiview/* -// var multiviewFS embed.FS +//go:embed vMixMultiview/index.html +//go:embed vMixMultiview/script.js +//go:embed vMixMultiview/jquery.js +//go:embed vMixMultiview/style.css +var multiviewFS embed.FS func main() { log.Println("STARTING...") @@ -95,17 +96,15 @@ func main() { } c.Data(http.StatusOK, "text/css", b) }) - /* - r.GET("/multiviewer/*file", func(c *gin.Context) { - file := c.Param("file") - b, err := multiviewFS.ReadFile("vMixMultiview" + file) - if err != nil { - c.AbortWithError(http.StatusNotFound, err) - return - } - c.Data(http.StatusOK, "", b) - }) - */ + r.GET("/multiviewer/*file", func(c *gin.Context) { + file := c.Param("file") + b, err := multiviewFS.ReadFile("vMixMultiview" + file) + if err != nil { + c.AbortWithError(http.StatusNotFound, err) + return + } + c.Data(http.StatusOK, "", b) + }) api := r.Group("/api") { diff --git a/makefile b/makefile index 9110a6a..9d80995 100644 --- a/makefile +++ b/makefile @@ -56,7 +56,7 @@ build-server: build-prepare #TODO: goxをやめる @cd ./server && go run github.com/mitchellh/gox@v1.0.1 --osarch "windows/amd64" --output ../$(DIST_DIR)/${BINARY_NAME}_{{.OS}}_{{.Arch}} ./ build-web: - @cd ./web && yarn run build + @cd ./web && yarn run build @$(MKDIR) ./$(SERVER_DIR)/static @$(RM) ./$(SERVER_DIR)/static/* @$(CP) ./web/dist/* ./$(SERVER_DIR)/static/ diff --git a/web/package.json b/web/package.json index 805d094..9504f08 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "build": "NODE_OPTIONS='--openssl-legacy-provider' vue-cli-service build", "lint": "vue-cli-service lint" }, "dependencies": { @@ -35,5 +35,8 @@ "typescript": "~3.7.5", "vue-cli-plugin-axios": "~0.0.4", "vue-template-compiler": "^2.6.11" + }, + "volta": { + "node": "20.13.1" } }