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 ( - + }> } /> 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()] })], -}); +}));