Add server/status.js

Add initial status API backend
This commit is contained in:
2026-08-06 18:33:18 +00:00
parent 5f4edf1924
commit 510dd2947d
+30
View File
@@ -0,0 +1,30 @@
const http = require('http');
const port = 8080;
const status = {
service: 'running',
bitcoinNode: 'not connected',
wallet: 'not configured',
labels: 0,
transactions: 0,
lastScan: 'never'
};
const server = http.createServer((req, res) => {
if (req.url === '/api/status') {
res.writeHead(200, {
'Content-Type': 'application/json',
});
res.end(JSON.stringify(status));
return;
}
res.writeHead(404);
res.end('Not found');
});
server.listen(port, () => {
console.log(`Status API listening on port ${port}`);
});