@mcpjam/inspector 0.9.0 → 0.9.1
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/start.js +4 -3
- package/package.json +1 -1
package/bin/start.js
CHANGED
|
@@ -110,13 +110,14 @@ function isPortAvailable(port) {
|
|
|
110
110
|
const server = createServer();
|
|
111
111
|
|
|
112
112
|
server.listen(port, () => {
|
|
113
|
-
|
|
113
|
+
// Port is available, close the server and resolve true
|
|
114
|
+
server.close(() => {
|
|
114
115
|
resolve(true);
|
|
115
116
|
});
|
|
116
|
-
server.close();
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
server.on("error", () => {
|
|
120
|
+
// Port is not available
|
|
120
121
|
resolve(false);
|
|
121
122
|
});
|
|
122
123
|
});
|
|
@@ -402,7 +403,7 @@ async function main() {
|
|
|
402
403
|
Object.assign(process.env, envVars);
|
|
403
404
|
|
|
404
405
|
// Port discovery and configuration
|
|
405
|
-
const requestedPort = parseInt(process.env.PORT ?? "
|
|
406
|
+
const requestedPort = parseInt(process.env.PORT ?? "6274", 10);
|
|
406
407
|
let PORT;
|
|
407
408
|
|
|
408
409
|
try {
|