-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdiagnostic-check.cjs
More file actions
32 lines (28 loc) · 1.02 KB
/
Copy pathdiagnostic-check.cjs
File metadata and controls
32 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Quick diagnostic to check SOMA configuration
const http = require('http');
console.log('=== SOMA Diagnostic Check ===\n');
// Check 1: Backend port 3001
console.log('Checking backend on port 3001...');
const req = http.get('http://localhost:3001/health', (res) => {
let data = '';
res.on('data', chunk => data += chunk);
res.on('end', () => {
console.log('✅ Backend is responding:', data);
process.exit(0);
});
});
req.on('error', (err) => {
console.log('❌ Backend is NOT responding:', err.message);
console.log('\nTroubleshooting:');
console.log('1. Run: npm run soma');
console.log('2. Wait for "SOMA Server running on port 3001"');
console.log('3. Then run this diagnostic again\n');
process.exit(1);
});
req.setTimeout(5000, () => {
console.log('❌ Backend connection TIMEOUT (server hung)');
console.log('\nThe backend is listening but not responding to requests.');
console.log('This means the server is likely frozen or stuck during initialization.\n');
req.destroy();
process.exit(1);
});