Skip to content

Commit 044b4c3

Browse files
committed
update dev env
Signed-off-by: wwanarif <[email protected]>
1 parent 1acf5eb commit 044b4c3

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

studio-frontend/.env.development

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
NODE_TLS_REJECT_UNAUTHORIZED=0
2+
VITE_DISABLE_KEYCLOAK=true
3+
NODE_ENV=development
4+
VITE_HOST=0.0.0.0
5+
VITE_PORT=8088

studio-frontend/docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
- /usr/src/node_modules
2020
- /usr/src/.pnpm-store
2121
- /usr/src/packages/ui/build
22-
command: ["sh", "-c", "pnpm dev"]
22+
command: ["sh", "-c", "cp /usr/src/.env.development /usr/src/packages/ui/.env; cp /usr/src/.env.development /usr/src/packages/server/.env; pnpm dev"]
2323
environment:
2424
- http_proxy=${http_proxy}
2525
- https_proxy=${https_proxy}

studio-frontend/packages/server/src/index.ts

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,36 @@ export class App {
227227
const packagePath = getNodeModulesPackagePath('flowise-ui')
228228
const uiBuildPath = path.join(packagePath, 'build')
229229
const uiHtmlPath = path.join(packagePath, 'build', 'index.html')
230+
const nodeEnv = process.env.NODE_ENV || 'undefined'
231+
232+
// Treat any non-production environment as development for the landing page
233+
if (nodeEnv === 'development') {
234+
this.app.get('/', (req: Request, res: Response) => {
235+
res.send(`<!doctype html>
236+
<html>
237+
<head>
238+
<meta charset="utf-8" />
239+
<meta name="viewport" content="width=device-width, initial-scale=1" />
240+
<title>Flowise Server (development)</title>
241+
<style>body{font-family:system-ui,Arial;margin:2rem;}a{color:#1a73e8}</style>
242+
</head>
243+
<body>
244+
<h1>Flowise Server</h1>
245+
<p><strong>Mode:</strong> development</p>
246+
<p>Server is listening on port 3000.</p>
247+
<p>UI is listening on port 8088.</p>
248+
<p><a href="/api/v1/ping" target="_blank" rel="noopener">Ping API</a></p>
249+
</body>
250+
</html>`)
251+
})
252+
} else {
253+
this.app.use('/', express.static(uiBuildPath))
230254

231-
this.app.use('/', express.static(uiBuildPath))
232-
233-
// All other requests not handled will return React app
234-
this.app.use((req: Request, res: Response) => {
235-
res.sendFile(uiHtmlPath)
236-
})
255+
// All other requests not handled will return React app
256+
this.app.use((req: Request, res: Response) => {
257+
res.sendFile(uiHtmlPath)
258+
})
259+
}
237260

238261
// Error handling
239262
this.app.use(errorHandlerMiddleware)

studio-frontend/packages/ui/.env.development

Lines changed: 0 additions & 2 deletions
This file was deleted.

studio-frontend/packages/ui/src/menu-items/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const dashboard = {
2525
children: [
2626
{
2727
id: 'opeaflows',
28-
title: 'OPEA Flows',
28+
title: 'Workflows',
2929
type: 'item',
3030
url: '/opeaflows',
3131
icon: icons.IconApps,

studio-frontend/packages/ui/src/views/opeaflows/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const Opeaflows = () => {
172172
}}
173173
variant='h1'
174174
>
175-
OPEA Flows
175+
Workflows
176176
</Typography>
177177
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 2 }}>
178178
<Box sx={{ display: 'flex', gap: 2 }}>

0 commit comments

Comments
 (0)