forked from clabroche/rhea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstack.js
52 lines (45 loc) · 1.13 KB
/
stack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
let BASE
BASE = "rhea"
const stack = [
{
label: 'rhea-server',
spawnCmd: 'npm',
spawnArgs: ['run', 'server'],
spawnOptions: {
cwd: __dirname,
env: Object.assign({
PORT: '4215',
mongoDbURL:`mongodb://root:123456@localhost:27017/${BASE}?authSource=admin`
}, process.env)
}
},
{
label: 'rhea-front',
spawnCmd: 'npm',
spawnArgs: ['run', 'client'],
spawnOptions: {
cwd: __dirname,
env: Object.assign({
VUE_APP_SERVER_URL: 'http://localhost',
VUE_APP_SERVER_PORT: 4215,
VUE_APP_VERSION: 'v0.0.0'
}, process.env)
}
},
{
label: 'rhea-front-cordova',
spawnCmd: 'npm',
spawnArgs: ['run', 'capacitor:serve -- --android'],
spawnOptions: {
cwd: __dirname,
env: Object.assign({
VUE_APP_SERVER_URL: 'http://localhost',
VUE_APP_SERVER_PORT: 4215,
}, process.env)
}
}
]
require('dns').lookup(require('os').hostname(), function (err, add) {
stack.filter(({label}) => label.includes('front-cordova')).pop().spawnOptions.env.VUE_APP_SERVER_URL = `http://${add}`
})
module.exports = stack