Skip to content

Commit 30b1c69

Browse files
authored
Merge pull request elizaOS#2353 from C0ldSmi1e/develop
fix: align base url in client if api runs on a different port
2 parents e36327a + fe83ae2 commit 30b1c69

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PGLITE_DATA_DIR= #../pgLite/ if selecting a directory --- or memory:// if
99

1010
# Eliza Port Config
1111
SERVER_PORT=3000
12+
VITE_SERVER_PORT=${SERVER_PORT}
1213

1314
# Supabase Configuration
1415
SUPABASE_URL=

client/src/lib/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type UUID, type Character } from "@elizaos/core";
22

3-
const BASE_URL = "http://localhost:3000";
3+
const BASE_URL = `http://localhost:${import.meta.env.VITE_SERVER_PORT}`;
44

55
const fetcher = async ({
66
url,

client/vite.config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react-swc";
33
import viteCompression from "vite-plugin-compression";
4+
import path from "path";
45

56
// https://vite.dev/config/
67
export default defineConfig({
@@ -13,6 +14,7 @@ export default defineConfig({
1314
}),
1415
],
1516
clearScreen: false,
17+
envDir: path.resolve(__dirname, ".."),
1618
build: {
1719
outDir: "dist",
1820
minify: true,

0 commit comments

Comments
 (0)