|
|
@ -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));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|