ping: Changed date output format to ISO

master release-2019-10-06-12-15
Felix Stupp 5 years ago
parent f31e78fd9d
commit b0d3fcc672
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -1,5 +1,6 @@
let express = require("express"); let express = require("express");
let ipaddr = require("ipaddr.js"); let ipaddr = require("ipaddr.js");
let moment = require("moment");
let db = require("../libs/Database").instance(); let db = require("../libs/Database").instance();
let router = express.Router(); let router = express.Router();
@ -35,9 +36,9 @@ router.get("/:fqdn", (req, res) => {
if (!d) return res.status(404).send("Unknown FQDN"); if (!d) return res.status(404).send("Unknown FQDN");
res.send([ res.send([
d.ipv4 ? d.ipv4 : "0.0.0.0", d.ipv4 ? d.ipv4 : "0.0.0.0",
d.ipv4LastPing, moment(d.ipv4LastPing).toISOString(),
d.ipv6 ? d.ipv6 : "::", d.ipv6 ? d.ipv6 : "::",
d.ipv6LastPing, moment(d.ipv6LastPing).toISOString(),
].reduce((a, b) => a + "\n" + b)); ].reduce((a, b) => a + "\n" + b));
}); });
}); });

Loading…
Cancel
Save