Commit 442e4dab authored by 神楽坂玲奈's avatar 神楽坂玲奈

test

parent c567d199
......@@ -79,7 +79,8 @@ socket.bind(config.port);
http
.createServer(function(req, res) {
res.writeHead(200, { 'Content-Type': 'application/json' });
const result: Record<number, Record<number, number>> = Object.fromEntries(Router.all.map(from => [from.id, Object.fromEntries([...from.via.entries()].map(([to, via]) => [to.id, via.id]))]));
const result = Router.all.map(from => ({id: from.id, peers: from.peers, via: Object.fromEntries([...from.via.entries()].map(([to, via]) => [to.id, via.id]))}));
// const result: Record<number, Record<number, number>> = Object.fromEntries(Router.all.map(from => [from.id, ]));
return res.end(JSON.stringify(result));
})
.on('listening', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment