@whoz-oss/coday-server 0.0.0-workstream-setup.2 → 0.0.0-workstream-forge.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +3 -13
- package/package.json +1 -1
- package/server.js +55 -62
package/bin.js
CHANGED
|
@@ -6,25 +6,15 @@ import { fileURLToPath } from 'url';
|
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = dirname(__filename);
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* `coday-server [provision|agentos|factory|server] [--configDir <dir>] ...`
|
|
11
|
-
*
|
|
12
|
-
* Runs the compiled server bundle with the given arguments. Without a command it runs everything in
|
|
13
|
-
* one process (Express + AgentOS + Factory). The Nx tasks of the generated runtime workspace call
|
|
14
|
-
* the commands (see apps/web).
|
|
15
|
-
*/
|
|
16
9
|
const serverPath = resolve(__dirname, 'server.js');
|
|
17
10
|
const args = process.argv.slice(2);
|
|
18
11
|
|
|
19
|
-
//
|
|
20
|
-
const child = spawn(
|
|
12
|
+
// Run the compiled JavaScript server
|
|
13
|
+
const child = spawn('node', [serverPath, ...args], {
|
|
21
14
|
stdio: 'inherit',
|
|
15
|
+
shell: true
|
|
22
16
|
});
|
|
23
17
|
|
|
24
|
-
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
|
|
25
|
-
process.on(signal, () => child.kill(signal));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
18
|
child.on('exit', (code) => {
|
|
29
19
|
process.exit(code || 0);
|
|
30
20
|
});
|