From e344e3d4cc7a161afb5caafb294a84079eae1fb1 Mon Sep 17 00:00:00 2001 From: MrPiglr <31398225+MrPiglr@users.noreply.github.com> Date: Thu, 25 Dec 2025 09:48:53 +0000 Subject: [PATCH] Fix port conflict: separate health and web server ports --- aethex-bot/bot.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aethex-bot/bot.js b/aethex-bot/bot.js index 22422d8..ad6aa41 100644 --- a/aethex-bot/bot.js +++ b/aethex-bot/bot.js @@ -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);