Spaces:
Running
Running
Commit
·
f1ca1c5
1
Parent(s):
389d1d0
fixed issue where we used the same port 1688
Browse files- myNodeServer.js +8 -2
myNodeServer.js
CHANGED
@@ -2,7 +2,7 @@ const http = require('http');
|
|
2 |
const { spawn } = require('child_process');
|
3 |
|
4 |
const PROXY_PORT_HUGGINGFACE = 4444; // Change this to a port different from 1688
|
5 |
-
const PROXY_PORT_OMNITOOL =
|
6 |
const CONTAINER_HOST = '127.0.0.1';
|
7 |
const CONTAINER_PORT_OMNITOOL = 1688;
|
8 |
const PROTOCOL = 'https';
|
@@ -43,11 +43,16 @@ async function startOmnitoolServer()
|
|
43 |
omnitoolStartProcess.stderr.on('data', (data) =>
|
44 |
{
|
45 |
console.error(`omnitool stderr: ${data}`);
|
|
|
|
|
46 |
});
|
47 |
|
48 |
omnitoolStartProcess.on('close', (code) =>
|
49 |
{
|
50 |
-
|
|
|
|
|
|
|
51 |
if (!OMNITOOL_READY)
|
52 |
{
|
53 |
ALREADY_STARTING = false;
|
@@ -409,6 +414,7 @@ async function startManagementServer()
|
|
409 |
}
|
410 |
}
|
411 |
|
|
|
412 |
// Start the servers
|
413 |
startManagementServer();
|
414 |
|
|
|
2 |
const { spawn } = require('child_process');
|
3 |
|
4 |
const PROXY_PORT_HUGGINGFACE = 4444; // Change this to a port different from 1688
|
5 |
+
const PROXY_PORT_OMNITOOL = 1689; // Change this to a port different from 1688
|
6 |
const CONTAINER_HOST = '127.0.0.1';
|
7 |
const CONTAINER_PORT_OMNITOOL = 1688;
|
8 |
const PROTOCOL = 'https';
|
|
|
43 |
omnitoolStartProcess.stderr.on('data', (data) =>
|
44 |
{
|
45 |
console.error(`omnitool stderr: ${data}`);
|
46 |
+
omnitoolLogs.push(data.toString());
|
47 |
+
|
48 |
});
|
49 |
|
50 |
omnitoolStartProcess.on('close', (code) =>
|
51 |
{
|
52 |
+
const message = `Omnitool server process exited with code: ${code}`;
|
53 |
+
console.log(message);
|
54 |
+
omnitoolLogs.push(message);
|
55 |
+
|
56 |
if (!OMNITOOL_READY)
|
57 |
{
|
58 |
ALREADY_STARTING = false;
|
|
|
414 |
}
|
415 |
}
|
416 |
|
417 |
+
// main
|
418 |
// Start the servers
|
419 |
startManagementServer();
|
420 |
|