From bab64e2768ee242766a0fe1407552cc44f016090 Mon Sep 17 00:00:00 2001 From: Ronny Engan Date: Fri, 16 Oct 2026 14:32:20 +0200 Subject: [PATCH 1/2] fix: configure frontend for VM deployment --- client/src/apollo/client.ts | 2 +- client/vite.config.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/apollo/client.ts b/client/src/apollo/client.ts index a5875be..c798687 100644 --- a/client/src/apollo/client.ts +++ b/client/src/apollo/client.ts @@ -1,7 +1,7 @@ import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'; // GraphQL server address. Override with VITE_GRAPHQL_URL in .env (e.g. on the VM) -const uri = import.meta.env.VITE_GRAPHQL_URL ?? 'http://localhost:3001/graphql'; +const uri = import.meta.env.VITE_GRAPHQL_URL ?? '/project2/graphql';; export const client = new ApolloClient({ link: new HttpLink({ uri }), // how requests reach the server diff --git a/client/vite.config.ts b/client/vite.config.ts index 7236772..c550503 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -3,6 +3,7 @@ import babel from '@rolldown/plugin-babel'; import { defineConfig } from 'vite'; // https://vite.dev/config/ -export default defineConfig({ +export default defineConfig(({ command }) => ({ + base: command === 'build' ? '/project2/' : '/', plugins: [react(), babel({ presets: [reactCompilerPreset()] })], -}); +})); From dd8b9d4799370c15e4528d3b641781a33155220e Mon Sep 17 00:00:00 2001 From: Ronny Engan Date: Fri, 16 Oct 2026 14:45:24 +0200 Subject: [PATCH 2/2] fix: support project2 base path in React Router --- client/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index d91ecbc..e2ab86d 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -11,7 +11,7 @@ function ShelfPlaceholder() { /* ---------- Routes ---------- */ export function App() { return ( - + }> } />