1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-26 10:05:10 +00:00
This commit is contained in:
zumbiepig
2024-09-03 08:58:57 -07:00
parent ad807eea2f
commit db06d153bc
4 changed files with 96 additions and 87 deletions

View File

@@ -57,7 +57,14 @@ app.use(async (err, req, res, next) => {
next();
});
app.listen(PORT, async () => {
debugLogger('Server started.');
console.log(chalk.green(`Server is running on port ${PORT}`));
});
app
.listen(PORT, async () => {
debugLogger('Server started.');
console.log(chalk.green(`Server is running on port ${PORT}`));
})
.on('error', (error) => {
if (error.code === 'EADDRINUSE') {
console.error(chalk.red('EADDRINUSE') + chalk.gray(': ') + chalk.bold(`Failed to start server. Is port ${PORT} in use?`));
process.exit(1);
}
});