Revert "Move the webapp from /app/… to /app/v3/…"

This reverts commit fcb261f5d336c4362339e6da5b35a340ec5aa6e1. The
`/app/v3` URL didn't look nice enough.
This commit is contained in:
Sybren A. Stüvel 2022-07-05 11:51:05 +02:00
parent 2965856aa3
commit feaf9545a6
4 changed files with 14 additions and 14 deletions

@ -56,10 +56,10 @@ webapp:
webapp-static: addon-packer
$(MAKE) clean-webapp-static
# When changing the base URL, also update the line
# e.GET("/app/v3/*", echo.WrapHandler(webAppHandler))
# e.GET("/app/*", echo.WrapHandler(webAppHandler))
# in `cmd/flamenco-manager/main.go`
yarn --cwd web/app build --outDir ../static --base=/app/v3/
# yarn --cwd web/app build --outDir ../static --base=/app/v3/ --minify false
yarn --cwd web/app build --outDir ../static --base=/app/
# yarn --cwd web/app build --outDir ../static --base=/app/ --minify false
./addon-packer -filename ${WEB_STATIC}/flamenco3-addon.zip
@echo "Web app has been installed into ${WEB_STATIC}"

@ -298,12 +298,15 @@ func buildWebService(
})
}
// Serve static files for the webapp on /app/v3/.
// Serve static files for the webapp on /app/.
webAppHandler, err := web.WebAppHandler()
if err != nil {
log.Fatal().Err(err).Msg("unable to set up HTTP server for embedded web app")
}
e.GET("/app/v3/*", echo.WrapHandler(http.StripPrefix("/app/v3", webAppHandler)))
e.GET("/app/*", echo.WrapHandler(http.StripPrefix("/app", webAppHandler)))
e.GET("/app", func(c echo.Context) error {
return c.Redirect(http.StatusTemporaryRedirect, "/app/")
})
// Serve the Blender add-on. It's contained in the static files of the webapp.
e.GET("/flamenco3-addon.zip", echo.WrapHandler(webAppHandler))
@ -318,13 +321,10 @@ func buildWebService(
Msg("serving job-specific files directly from disk")
e.Static(api_impl.JobFilesURLPrefix, localStorage.Root())
// Redirect / and subsets of the webapp URL to the actual webapp URL.
redirectToWebapp := func(c echo.Context) error {
return c.Redirect(http.StatusTemporaryRedirect, "/app/v3/")
}
e.GET("/app/v3", redirectToWebapp)
e.GET("/app/", redirectToWebapp)
e.GET("/", redirectToWebapp)
// Redirect / to the webapp.
e.GET("/", func(c echo.Context) error {
return c.Redirect(http.StatusTemporaryRedirect, "/app/")
})
// Log available routes
routeLogger := log.Level(zerolog.TraceLevel)

@ -12,7 +12,7 @@
}
],
"scripts": {
"dev": "vite --port 8081 --base /app/v3/",
"dev": "vite --port 8081 --base /app/",
"build": "vite build",
"preview": "vite preview --port 5050",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"

@ -53,7 +53,7 @@ function setImageURL(thumbnailInfo) {
if (thumbnailInfo == null) {
// This indicates that there is no last-rendered image.
// Default to a hard-coded 'nothing to be seen here, move along' image.
imageURL.value = "/app/v3/nothing-rendered-yet.svg";
imageURL.value = "/app/nothing-rendered-yet.svg";
cssClasses['nothing-rendered-yet'] = true;
console.log("LastRenderedImage.vue: setting image URL to:", imageURL.value);
return;