Skip to content

Commit

Permalink
Merge pull request #2353 from C0ldSmi1e/develop
Browse files Browse the repository at this point in the history
fix: align base url in client if api runs on a different port
  • Loading branch information
odilitime authored Jan 16, 2025
2 parents e36327a + fe83ae2 commit 30b1c69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PGLITE_DATA_DIR= #../pgLite/ if selecting a directory --- or memory:// if

# Eliza Port Config
SERVER_PORT=3000
VITE_SERVER_PORT=${SERVER_PORT}

# Supabase Configuration
SUPABASE_URL=
Expand Down
2 changes: 1 addition & 1 deletion client/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type UUID, type Character } from "@elizaos/core";

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

const fetcher = async ({
url,
Expand Down
2 changes: 2 additions & 0 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import viteCompression from "vite-plugin-compression";
import path from "path";

// https://vite.dev/config/
export default defineConfig({
Expand All @@ -13,6 +14,7 @@ export default defineConfig({
}),
],
clearScreen: false,
envDir: path.resolve(__dirname, ".."),
build: {
outDir: "dist",
minify: true,
Expand Down

0 comments on commit 30b1c69

Please sign in to comment.