satellite/console,web/satellite: Change Vuetify app prefix to "v2"

Change-Id: Ib0e14bd2f5056c6300a640e678413de767e8ee6d
This commit is contained in:
Moby von Briesen 2023-10-13 16:16:33 -04:00 committed by Storj Robot
parent 2cf4784b20
commit e0cf6f1e8b
3 changed files with 6 additions and 6 deletions

View File

@ -409,7 +409,7 @@ func NewServer(logger *zap.Logger, config Config, service *console.Service, oidc
router.Host(server.config.VuetifyHost).Handler(server.withCORS(http.HandlerFunc(server.vuetifyAppHandler))) router.Host(server.config.VuetifyHost).Handler(server.withCORS(http.HandlerFunc(server.vuetifyAppHandler)))
} else { } else {
// if not using a custom subdomain for vuetify, use a path prefix on the same domain as the production app // if not using a custom subdomain for vuetify, use a path prefix on the same domain as the production app
router.PathPrefix("/vuetifypoc").Handler(server.withCORS(http.HandlerFunc(server.vuetifyAppHandler))) router.PathPrefix("/v2").Handler(server.withCORS(http.HandlerFunc(server.vuetifyAppHandler)))
} }
} }
router.PathPrefix("/").Handler(server.withCORS(http.HandlerFunc(server.appHandler))) router.PathPrefix("/").Handler(server.withCORS(http.HandlerFunc(server.appHandler)))
@ -522,7 +522,7 @@ func NewFrontendServer(logger *zap.Logger, config Config, listener net.Listener,
router.PathPrefix("/static/").Handler(server.brotliMiddleware(http.StripPrefix("/static", fs))) router.PathPrefix("/static/").Handler(server.brotliMiddleware(http.StripPrefix("/static", fs)))
router.HandleFunc("/config", server.frontendConfigHandler) router.HandleFunc("/config", server.frontendConfigHandler)
if server.config.UseVuetifyProject { if server.config.UseVuetifyProject {
router.PathPrefix("/vuetifypoc").Handler(http.HandlerFunc(server.vuetifyAppHandler)) router.PathPrefix("/v2").Handler(http.HandlerFunc(server.vuetifyAppHandler))
} }
router.PathPrefix("/").Handler(http.HandlerFunc(server.appHandler)) router.PathPrefix("/").Handler(http.HandlerFunc(server.appHandler))
server.server = http.Server{ server.server = http.Server{

View File

@ -239,11 +239,11 @@ func TestConsoleBackendWithDisabledFrontEnd(t *testing.T) {
uiAddr := planet.Satellites[0].UI.Console.Listener.Addr().String() uiAddr := planet.Satellites[0].UI.Console.Listener.Addr().String()
testEndpoint(ctx, t, apiAddr, "/", http.StatusNotFound) testEndpoint(ctx, t, apiAddr, "/", http.StatusNotFound)
testEndpoint(ctx, t, apiAddr, "/vuetifypoc", http.StatusNotFound) testEndpoint(ctx, t, apiAddr, "/v2", http.StatusNotFound)
testEndpoint(ctx, t, apiAddr, "/static/", http.StatusNotFound) testEndpoint(ctx, t, apiAddr, "/static/", http.StatusNotFound)
testEndpoint(ctx, t, uiAddr, "/", http.StatusOK) testEndpoint(ctx, t, uiAddr, "/", http.StatusOK)
testEndpoint(ctx, t, uiAddr, "/vuetifypoc", http.StatusOK) testEndpoint(ctx, t, uiAddr, "/v2", http.StatusOK)
testEndpoint(ctx, t, uiAddr, "/static/", http.StatusOK) testEndpoint(ctx, t, uiAddr, "/static/", http.StatusOK)
}) })
} }
@ -260,7 +260,7 @@ func TestConsoleBackendWithEnabledFrontEnd(t *testing.T) {
apiAddr := planet.Satellites[0].API.Console.Listener.Addr().String() apiAddr := planet.Satellites[0].API.Console.Listener.Addr().String()
testEndpoint(ctx, t, apiAddr, "/", http.StatusOK) testEndpoint(ctx, t, apiAddr, "/", http.StatusOK)
testEndpoint(ctx, t, apiAddr, "/vuetifypoc", http.StatusOK) testEndpoint(ctx, t, apiAddr, "/v2", http.StatusOK)
testEndpoint(ctx, t, apiAddr, "/static/", http.StatusOK) testEndpoint(ctx, t, apiAddr, "/static/", http.StatusOK)
}) })
} }

View File

@ -1,2 +1,2 @@
VITE_ENDPOINT_URL=/api/v0/graphql VITE_ENDPOINT_URL=/api/v0/graphql
VITE_VUETIFY_PREFIX=vuetifypoc VITE_VUETIFY_PREFIX=v2