feat: show member details

This commit is contained in:
2025-08-24 21:20:18 +02:00
parent 4ab19e9ded
commit a437fb0eea
3 changed files with 249 additions and 12 deletions

View File

@@ -58,6 +58,25 @@ app.get('/api/node/status', async (req, res) => {
}
});
// Proxy endpoint to get status from a specific node
app.get('/api/node/status/:ip', async (req, res) => {
try {
const nodeIp = req.params.ip;
// Create a temporary client for the specific node
const nodeClient = new SporeApiClient(`http://${nodeIp}`);
const nodeStatus = await nodeClient.getSystemStatus();
res.json(nodeStatus);
} catch (error) {
console.error(`Error fetching status from node ${req.params.ip}:`, error);
res.status(500).json({
error: `Failed to fetch status from node ${req.params.ip}`,
message: error.message
});
}
});
// Start the server
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);