fix: topology container height

This commit is contained in:
2025-08-30 20:41:00 +02:00
parent 9fba644a18
commit c05a2b6c30
26 changed files with 147 additions and 4574 deletions

View File

@@ -3,6 +3,7 @@ const path = require('path');
const fs = require('fs');
const dgram = require('dgram');
const SporeApiClient = require('./src/client');
const cors = require('cors');
const app = express();
const PORT = process.env.PORT || 3001;
@@ -20,6 +21,13 @@ app.use(fileUpload({
debug: false
}));
// Add CORS middleware
app.use(cors({
origin: '*', // Or specify your phone's IP range like: ['http://192.168.1.0/24']
methods: ['GET', 'POST', 'PUT', 'DELETE'],
allowedHeaders: ['Content-Type', 'Authorization']
}));
// UDP discovery configuration
const UDP_PORT = 4210;
const DISCOVERY_MESSAGE = 'CLUSTER_DISCOVERY';
@@ -700,8 +708,9 @@ app.get('/api/health', (req, res) => {
// Start the server
const server = app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
const server = app.listen(PORT, '0.0.0.0', () => {
console.log(`Server is running on http://0.0.0.0:${PORT}`);
console.log(`Accessible from: http://YOUR_COMPUTER_IP:${PORT}`);
console.log(`UDP discovery server listening on port ${UDP_PORT}`);
console.log('Waiting for CLUSTER_DISCOVERY messages from SPORE nodes...');
});