diff --git a/internal/api/routes.go b/internal/api/routes.go index 6674d49..5bc3556 100644 --- a/internal/api/routes.go +++ b/internal/api/routes.go @@ -219,7 +219,7 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs, studio http.Handler) http.Handler { adminOnly := httpmiddleware.RequirePlatformAdmin() gr.Use(authUser) gr.Use(adminOnly) - gr.Mount("/db-studio", http.StripPrefix("/db-studio", studio)) + gr.Mount("/db-studio", studio) }) } diff --git a/internal/web/pgweb_proxy.go b/internal/web/pgweb_proxy.go index 8f40e39..522ae45 100644 --- a/internal/web/pgweb_proxy.go +++ b/internal/web/pgweb_proxy.go @@ -35,6 +35,7 @@ func StartPgweb(dbURL, host, port string, readonly bool, user, pass string) (*Pg "--url", dbURL, "--bind", host, "--listen", port, + "--prefix", "/db-studio", "--skip-open", } if readonly { diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 572ea19..fbef884 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -1,32 +1,34 @@ import path from "path" import tailwindcss from "@tailwindcss/vite" -import { defineConfig } from "vite" import react from "@vitejs/plugin-react" +import { defineConfig } from "vite" // https://vite.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss()], - resolve: { - alias: { - "@": path.resolve(__dirname, "./src"), - } + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), }, - server: { - port: 5173, - proxy: { - "/api": "http://localhost:8080", - "/swagger": "http://localhost:8080", - "/db-studio": "http://localhost:8080", - }, - allowedHosts: ['.getexposed.io'] + }, + server: { + port: 5173, + proxy: { + "/api": "http://localhost:8080", + "/swagger": "http://localhost:8080", + "/db-studio": "http://localhost:8080", }, - build: { - chunkSizeWarningLimit: 1000, - outDir: "../internal/web/dist", - emptyOutDir: true, - sourcemap: true, - cssMinify: "lightningcss", - rollupOptions: { output: { manualChunks: { react: ["react","react-dom","react-router-dom"] } } } + allowedHosts: [".getexposed.io"], + }, + build: { + chunkSizeWarningLimit: 1000, + outDir: "../internal/web/dist", + emptyOutDir: true, + sourcemap: true, + cssMinify: "lightningcss", + rollupOptions: { + output: { manualChunks: { react: ["react", "react-dom", "react-router-dom"] } }, }, - esbuild: { legalComments: "none" } + }, + esbuild: { legalComments: "none" }, })