Restored to 'afb7a90e0a9fbf19dfd193a47ef6054a853fdd60'

Replit-Restored-To: afb7a90e0a
This commit is contained in:
michaelschal committed 2025-07-13 13:04:02 +00:00
1 parent 55fb5abd45
commit 04e8eea3bd
12 files changed
+126 -339

No files matched your search

+3 -2
View File
@@ -58,9 +58,10 @@ app.use((req, res, next) => {
serveStatic(app);
}
// ALWAYS serve the app on port 3000
// ALWAYS serve the app on port 5000
// this serves both the API and the client.
const port = process.env.PORT ? parseInt(process.env.PORT) : 3000;
// It is the only port that is not firewalled.
const port = 5000;
server.listen({
port,
host: "0.0.0.0",
-34
View File
@@ -1,34 +0,0 @@
// Production startup script for Node.js 18 compatibility
// Fixes import.meta.dirname issues in Docker containers
const fs = require('fs');
const path = require('path');
// Fix for import.meta.dirname in Node.js 18
const distPath = path.join(__dirname, '../dist/index.js');
if (fs.existsSync(distPath)) {
console.log('🔧 Applying Node.js 18 compatibility fixes...');
let content = fs.readFileSync(distPath, 'utf8');
// Replace import.meta.dirname with static path
content = content.replace(
/import\.meta\.dirname/g,
'"/app"'
);
// Replace import.meta.url references if any
content = content.replace(
/import\.meta\.url/g,
'"file:///app"'
);
fs.writeFileSync(distPath, content);
console.log('✅ Compatibility fixes applied');
} else {
console.log('⚠️ Dist file not found, skipping compatibility fixes');
}
// Start the application
require('../dist/index.js');