Обновить server/bc.js

This commit is contained in:
svoboda200786 2025-05-19 08:13:57 +00:00
parent 88bd4d0eaa
commit 60b8b26682

View File

@ -168,14 +168,14 @@ io.on('connection', (socket) => {
});
});
// Запуск HTTP сервера
const PORT = process.env.PORT || 3200;
server.listen(PORT, () => {
console.log(`[Server] Запущен на порту ${PORT}`);
console.log(`[Server] Раздача статики из: ${path.join(__dirname, '..', 'public')}`);
// db.js уже выводит сообщение о подключении к БД
});
const PORT = process.env.BC_INTERNAL_PORT || 3200; // Внутренний порт для bc.js
const HOSTNAME = '127.0.0.1'; // Слушать ТОЛЬКО на localhost
server.listen(PORT, HOSTNAME, () => { // Явно указываем HOSTNAME
console.log(`Battle Club HTTP Application Server running at http://${HOSTNAME}:${PORT}`);
console.log(`This server should only be accessed locally by the reverse proxy.`);
console.log(`Serving static files from: ${path.join(__dirname, 'public')}`);
});
// Обработка необработанных промис-ошибок
process.on('unhandledRejection', (reason, promise) => {
console.error('[Server FATAL] Unhandled Rejection at:', promise, 'reason:', reason);