|
|
@ -9,7 +9,7 @@ router.use((req, res, next) => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
router.get("/:fqdn", (req, res) => {
|
|
|
|
router.get("/:fqdn", (req, res) => {
|
|
|
|
db.q.select(["ipv4", "ipv6"]).from("addresses").where("fqdn", req.params.fqdn).first((e, d) => {
|
|
|
|
db.q.select(["ipv4", "ipv6"]).from("addresses").filter("fqdn", req.params.fqdn).first((e, d) => {
|
|
|
|
if (e) return res.status(400).send("Error");
|
|
|
|
if (e) return res.status(400).send("Error");
|
|
|
|
if (!d) return res.status(404).send("Unknown FQDN");
|
|
|
|
if (!d) return res.status(404).send("Unknown FQDN");
|
|
|
|
res.send(d.ipv4 ? (d.ipv6 ? d.ipv4 + "\n" + d.ipv6 : d.ipv4) : (d.ipv6 ? d.ipv6 : ""));
|
|
|
|
res.send(d.ipv4 ? (d.ipv6 ? d.ipv4 + "\n" + d.ipv6 : d.ipv4) : (d.ipv6 ? d.ipv6 : ""));
|
|
|
|