Skip to content

Commit

Permalink
Fixed a bigint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Umkus committed Nov 6, 2023
1 parent 2ec3718 commit 8f767b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ http.createServer(async (req, res) => {
'Content-Type': 'application/json',
});

res.write(JSON.stringify(getIpInfo(ip)));
res.write(JSON.stringify(getIpInfo(ip), (key, value) => {
if (typeof value === "bigint") {
return value.toString()
}

return value;
}));
res.end();
})
.listen(4000, '0.0.0.0');

0 comments on commit 8f767b9

Please sign in to comment.