Make local frontend backend configurable
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
5 files changed
+34
-12
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { ApolloClient, InMemoryCache } from "@apollo/client";
|
||||
|
||||
const client = new ApolloClient({
|
||||
uri: `${import.meta.env.VITE_API_URL}/graphql/`,
|
||||
uri: import.meta.env.DEV ? "/graphql/" : `${import.meta.env.VITE_API_URL}/graphql/`,
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
|
||||
|
||||
@@ -9,5 +9,13 @@ export default defineConfig({
|
||||
__DEV__: process.env.NODE_ENV !== "production",
|
||||
},
|
||||
envDir: "..",
|
||||
server: {
|
||||
host: "127.0.0.1",
|
||||
proxy: Object.fromEntries(
|
||||
["/admin", "/accounts", "/inventory", "/report", "/static", "/media", "/graphql"].map(
|
||||
(path) => [path, process.env.VITE_DEV_API_PROXY || "http://127.0.0.1:3000"],
|
||||
),
|
||||
),
|
||||
},
|
||||
build: { outDir: "../static", emptyOutDir: false },
|
||||
});
|
||||
Reference in new issue
Block a user