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);