mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
Adding console log on sandbox server startup (#2210)
* Adding console log on sandbox server startup * Update server.js Add server error handeling * Update server.js Better error message, remove retry. Co-authored-by: Philippe Recto <precto1285@gmal.com> Co-authored-by: Felipe Martins <felipewmartins@gmail.com> Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
+9
-1
@@ -69,4 +69,12 @@ server = http.createServer(function (req, res) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen(3000);
|
const PORT = 3000;
|
||||||
|
|
||||||
|
server.listen(PORT, console.log(`Listening on localhost:${PORT}...`));
|
||||||
|
server.on('error', (error) => {
|
||||||
|
if (error.code === 'EADDRINUSE') {
|
||||||
|
console.log(`Address localhost:${PORT} in use please retry when the port is available!`);
|
||||||
|
server.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user