-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.js
40 lines (33 loc) · 947 Bytes
/
dev.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
const path = require('path');
const childProcess = require('child_process');
const root = process.cwd();
console.log('Compiling Settings Files...');
// Compile settings files
childProcess.execSync('tsc generator.ts', {
cwd: root,
env: process.env,
stdio: 'inherit',
});
console.log('Launching Server...');
// Running node server
let server = childProcess.exec('node server.js', {
cwd: root,
env: process.env,
stdio: 'inherit',
});
console.log('Launching UI');
// Running angular CLI serve to serve front-end in dev mode
let ui = childProcess.exec('ng serve', {
cwd: path.join(root, 'web-gen-ui'),
env: process.env,
stdio: 'inherit',
});
console.log('Navigate to http://localhost:4200 in your browser...');
// Echo server console
server.stdout.on('data', function(data) {
console.log('Server: ' + data);
});
// Echo ui console
ui.stdout.on('data', function(data) {
console.log('UI: ' + data);
});