Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: align base url in client if api runs on a different port #2353

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading