handle server errors (#91)
This commit is contained in:
parent
4200a46fc2
commit
3dde360dc9
1 changed files with 50 additions and 10 deletions
|
|
@ -70,11 +70,19 @@ sandboxApp.use((_req, res) => {
|
|||
});
|
||||
|
||||
// ============ Start both servers ============
|
||||
hostApp.listen(HOST_PORT, () => {
|
||||
hostApp.listen(HOST_PORT, err => {
|
||||
if (err) {
|
||||
console.error("Error starting server:", err);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`Host server: http://localhost:${HOST_PORT}`);
|
||||
});
|
||||
|
||||
sandboxApp.listen(SANDBOX_PORT, () => {
|
||||
sandboxApp.listen(SANDBOX_PORT, err => {
|
||||
if (err) {
|
||||
console.error("Error starting server:", err);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`Sandbox server: http://localhost:${SANDBOX_PORT}`);
|
||||
console.log("\nPress Ctrl+C to stop\n");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue