← back to Atomic50 Onboard
atomic50 FIX 2: pin PORT fallback to 9942 (was 0 → random ephemeral port broke nginx upstream); add ecosystem.config.js pinning PORT=9942
2e4914fef7d76bed72ea1482c64f4d24d8941990 · 2026-07-13 15:13:13 -0700 · Steve
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Files touched
A ecosystem.config.jsM server.js
Diff
commit 2e4914fef7d76bed72ea1482c64f4d24d8941990
Author: Steve <steve@designerwallcoverings.com>
Date: Mon Jul 13 15:13:13 2026 -0700
atomic50 FIX 2: pin PORT fallback to 9942 (was 0 → random ephemeral port broke nginx upstream); add ecosystem.config.js pinning PORT=9942
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---
ecosystem.config.js | 19 +++++++++++++++++++
server.js | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/ecosystem.config.js b/ecosystem.config.js
new file mode 100644
index 0000000..8f3ae79
--- /dev/null
+++ b/ecosystem.config.js
@@ -0,0 +1,19 @@
+// Atomic 50 microsite — pm2 process definition.
+// PORT is PINNED to 9942 so restarts never bind a random ephemeral port
+// (which would break the nginx upstream). Matches server.js fallback + the
+// deploy memo's documented `pm2 start` line.
+module.exports = {
+ apps: [
+ {
+ name: 'atomic50',
+ script: 'server.js',
+ cwd: __dirname,
+ env: {
+ NODE_ENV: 'production',
+ PORT: 9942,
+ },
+ max_restarts: 10,
+ autorestart: true,
+ },
+ ],
+};
diff --git a/server.js b/server.js
index e80d588..0281f92 100644
--- a/server.js
+++ b/server.js
@@ -7,7 +7,7 @@ const express = require('express');
const fs = require('fs');
const path = require('path');
-const PORT = process.env.PORT || 0;
+const PORT = process.env.PORT || 9942;
const DATA = path.join(__dirname, 'data', 'products.json');
const app = express();
← c016f8e atomic50 microsite: drop unreachable/mixed-content spin GIFs
·
back to Atomic50 Onboard
·
atomic50 FIX 3: parse all_images as JSON array (jarr) instea 986f010 →