mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-12 01:17:48 +00:00
chore: add comments explaining host normalization
This commit is contained in:
@@ -2,12 +2,17 @@ import { defineConfig, loadEnv } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { getConnectableHost, normalizeLoopbackHost } from './shared/networkHosts.js'
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
export default defineConfig(({ mode }) => {
|
||||
// Load env file based on `mode` in the current working directory.
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
|
||||
const configuredHost = env.HOST || '0.0.0.0'
|
||||
// if the host is not a loopback address, it should be used directly.
|
||||
// This allows the vite server to EXPOSE all interfaces when the host
|
||||
// is set to '0.0.0.0' or '::', while still using 'localhost' for browser
|
||||
// URLs and proxy targets.
|
||||
const host = normalizeLoopbackHost(configuredHost)
|
||||
|
||||
const proxyHost = getConnectableHost(configuredHost)
|
||||
const serverPort = env.SERVER_PORT || 3001
|
||||
|
||||
|
||||
Reference in New Issue
Block a user