Skip to content

Commit 383a713

Browse files
Added env vars to ui and api URL (#3141)
* feat: add environment vars to split application in different deployments for better scalability * update: package.json added start script ui --------- Co-authored-by: patrick <[email protected]>
1 parent a6a0398 commit 383a713

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/ui/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
VITE_PORT=8080
2+
3+
# VITE_API_BASE_URL=http://localhost:3000
4+
# VITE_UI_BASE_URL=http://localhost:3000

packages/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
},
6363
"scripts": {
6464
"dev": "vite",
65+
"start": "vite",
6566
"build": "vite build",
6667
"clean": "rimraf build",
6768
"nuke": "rimraf build node_modules .turbo"

packages/ui/src/store/constant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const drawerWidth = 260
44
export const appDrawerWidth = 320
55
export const headerHeight = 80
66
export const maxScroll = 100000
7-
export const baseURL = window.location.origin
8-
export const uiBaseURL = window.location.origin
7+
export const baseURL = import.meta.env.VITE_API_BASE_URL || window.location.origin
8+
export const uiBaseURL = import.meta.env.VITE_UI_BASE_URL || window.location.origin
99
export const FLOWISE_CREDENTIAL_ID = 'FLOWISE_CREDENTIAL_ID'
1010
export const REDACTED_CREDENTIAL_VALUE = '_FLOWISE_BLANK_07167752-1a71-43b1-bf8f-4f32252165db'

0 commit comments

Comments
 (0)