site0230 commited on
Commit
2d2f58e
·
verified ·
1 Parent(s): 9187faf

Upload start.js

Browse files
Files changed (1) hide show
  1. proxy/start.js +18 -0
proxy/start.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { spawn } from 'child_process';
2
+
3
+ console.log('[Runner] Starting AIOStreams on PORT 3000...');
4
+ const aio = spawn(process.execPath, ['/app/packages/server/dist/server.js'], {
5
+ env: { ...process.env, PORT: '3000' },
6
+ stdio: 'inherit'
7
+ });
8
+
9
+ console.log('[Runner] Starting Proxy on PORT 7860...');
10
+ const proxy = spawn(process.execPath, ['/proxy/index.js'], {
11
+ env: { ...process.env, PORT: '7860' },
12
+ stdio: 'inherit'
13
+ });
14
+
15
+ process.on('SIGTERM', () => {
16
+ aio.kill('SIGTERM');
17
+ proxy.kill('SIGTERM');
18
+ });