-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧(frontend) pass host and port through environment vars
Configured the frontend to use environment variables (prefixed with "VITE_") for frontend port and host configuration, which will be overridden in the Helm chart values to ensure correct values are used in different environments. Helm requires the frontend port to be 8081 and use the public host, not the default "localhost" value.
- Loading branch information
1 parent
29a9b52
commit 35ebc5a
Showing
4 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { defineConfig } from 'vite' | ||
import { defineConfig, loadEnv } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
server: { | ||
port: 3000, | ||
}, | ||
export default defineConfig(({mode}) => { | ||
const env = loadEnv(mode, process.cwd()); | ||
return { | ||
plugins: [react()], | ||
server: { | ||
port: parseInt(env.VITE_PORT) || 3000, | ||
host: env.VITE_HOST || 'localhost', | ||
}, | ||
} | ||
}) |