Skip to content

Commit 821f585

Browse files
committed
add config
1 parent bf41e33 commit 821f585

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_BASE_URL=http://localhost:5002

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_BASE_URL=

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0-beta.4",
44
"scripts": {
55
"dev": "vite",
6-
"build": "vite build",
6+
"build": "vite build --mode production",
77
"start": "vite preview --port 5173 --host 0.0.0.0",
88
"test": "vitest",
99
"clean": "prettier --write src",
@@ -100,4 +100,4 @@
100100
"last 1 safari version"
101101
]
102102
}
103-
}
103+
}

src/lib/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Backend API configuration
2-
export const API_BASE_URL = '';
2+
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
3+
34

45
// API endpoints
56
export const API_ENDPOINTS = {

start.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,4 @@ fi
4242
# Start the frontend development server
4343
echo "Starting frontend server..."
4444
cd ../..
45-
npm run build
46-
npm start
45+
npm run dev

0 commit comments

Comments
 (0)