From de3fab3c70befe6920d5436ce0bef62f3e70ba29 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 22 Jul 2025 02:29:12 +0300 Subject: [api+ns] ns tool outputs JSON format and it's used for the API --- api/routes/getAKNSKey/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'api/routes/getAKNSKey') diff --git a/api/routes/getAKNSKey/index.js b/api/routes/getAKNSKey/index.js index c5adff0..5e78f81 100644 --- a/api/routes/getAKNSKey/index.js +++ b/api/routes/getAKNSKey/index.js @@ -13,7 +13,7 @@ const config = require("../../config.js"); function replyIfOkay(key, res) { const program = "ak-ns"; - const command = spawn(program, ["-rk", key]); + const command = spawn(program, ["-rj", key]); var buffer = ""; command.stdout.on("data", data => { buffer += data; @@ -29,10 +29,7 @@ function replyIfOkay(key, res) if (code === 0){ buffer = buffer.trim() res.writeHead(200, {'Content-Type': 'application/json'}); - res.end(JSON.stringify({ - key:`${key}`, - resolved:`${buffer}` - })); + res.end(`${buffer}`); } else { res.writeHead(404, {'Content-Type': 'application/json'}); res.end({"error":"unreachable"}); -- cgit v1.2.3