mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 11:01:18 +03:00
feat (server): add support for setting listening host (#2604)
This commit is contained in:
@@ -6,15 +6,17 @@ import dotenv from 'dotenv'
|
||||
export default defineConfig(async ({ mode }) => {
|
||||
let proxy = undefined
|
||||
if (mode === 'development') {
|
||||
const serverPort = parseInt(dotenv.config({ processEnv: {}, path: '../server/.env' }).parsed?.['PORT'])
|
||||
const serverEnv = dotenv.config({ processEnv: {}, path: '../server/.env' }).parsed
|
||||
const serverHost = serverEnv?.['HOST'] ?? 'localhost'
|
||||
const serverPort = parseInt(serverEnv?.['PORT'] ?? 3000)
|
||||
if (!Number.isNaN(serverPort) && serverPort > 0 && serverPort < 65535) {
|
||||
proxy = {
|
||||
'/api': {
|
||||
target: `http://localhost:${serverPort}`,
|
||||
target: `http://${serverHost}:${serverPort}`,
|
||||
changeOrigin: true
|
||||
},
|
||||
'/socket.io': {
|
||||
target: `http://localhost:${serverPort}`,
|
||||
target: `http://${serverHost}:${serverPort}`,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user