Fix port conflict: separate health and web server ports

This commit is contained in:
MrPiglr 2025-12-25 09:48:53 +00:00
parent a4549afd2a
commit e344e3d4cc

View file

@ -1462,7 +1462,9 @@ async function registerDiscordCommands() {
// HTTP SERVER (Modified: Added Sentinel stats to health endpoint)
// =============================================================================
const healthPort = process.env.HEALTH_PORT || 8080;
// Railway provides PORT - use it for the main web service
// Health server uses internal port or falls back to 3000
const healthPort = process.env.HEALTH_PORT || 3000;
const ADMIN_TOKEN = process.env.DISCORD_ADMIN_TOKEN || "aethex-bot-admin";
const checkAdminAuth = (req) => {
@ -2817,7 +2819,8 @@ httpServer.listen(healthPort, () => {
// EXPRESS WEB PORTAL (Discord OAuth, User Dashboard, API)
// =============================================================================
const webPort = process.env.PORT || 5000;
// Use Railway's PORT for main web service, default to 8080
const webPort = process.env.PORT || 8080;
const expressApp = createWebServer(client, supabase);
const webServer = http.createServer(expressApp);