Skip to content

Commit e02df04

Browse files
authored
feat: add env.json (#70)
1 parent 4b771d6 commit e02df04

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

client/.umirc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'umi';
22
import routes from './src/config/routes';
33
import { GetEnvironmentVariables } from '../server/app/util';
4+
import env from '../env.json';
45

56
process.env.MFSU_AD = 'none';
67

@@ -50,6 +51,7 @@ export default defineConfig({
5051
'process.env': {
5152
HOST: GetEnvironmentVariables(process.env),
5253
...process.env,
54+
...env,
5355
},
5456
},
5557
});

env.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"tugraph_db_host": "http://47.105.42.70:9090"
3+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { log } from 'console';
21
import { GetEnvironmentVariables } from '../../util';
3-
log(GetEnvironmentVariables(process.env), 'server');
2+
import env from '../../../../env.json';
43
const HOST = GetEnvironmentVariables(process.env);
4+
55
export const HOST_URL = `http://47.105.42.70:9090`;
66
export const DEV_HOST_URL = 'http://127.0.0.1:9090';
77
export const EngineServerURL = `${
8+
env?.tugraph_db_host ||
89
HOST?.tugraph_db_host ||
910
(process.env?.NODE_ENV === 'production' ? DEV_HOST_URL : HOST_URL)
1011
}/LGraphHttpService/Query`;
11-
log(EngineServerURL, 'eng');

0 commit comments

Comments
 (0)