From 904c6830fdbee04ebdb2cc985fa5c9eb22fb0d28 Mon Sep 17 00:00:00 2001 From: Napoleon-Christos Oikonomou Date: Sun, 8 Jan 2023 13:05:30 +0200 Subject: [PATCH] bugfix --- src/routes/call-by-meaning-routes.js | 3 +-- src/routes/get-by-meaning-routes.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/routes/call-by-meaning-routes.js b/src/routes/call-by-meaning-routes.js index 31394c1..127e336 100644 --- a/src/routes/call-by-meaning-routes.js +++ b/src/routes/call-by-meaning-routes.js @@ -67,8 +67,7 @@ router.post("/call", (req, res) => { return res.status(400).send("Input parameters must have the same length."); } - return request.post({ - uri: "/gbm/search/", + return request.post(`${req.protocol}://${req.get("host")}/gbm/search`, { form: { inputConcepts, outputConcepts }, }, (err, response, body) => { if (err) console.error(err); diff --git a/src/routes/get-by-meaning-routes.js b/src/routes/get-by-meaning-routes.js index c44f24b..35a0685 100644 --- a/src/routes/get-by-meaning-routes.js +++ b/src/routes/get-by-meaning-routes.js @@ -42,7 +42,7 @@ router.post("/search", (req, res) => { break; } - request.get(`/gbn/c/${outputConcepts[i]}`, (err2, response, body) => { + request.get(`${req.protocol}://${req.get("host")}/gbn/c/${outputConcepts[i]}`, (err2, response, body) => { if (response.statusCode !== 200) { return res.status(418).send(`Could not interpret the concept: ${outputConcepts[i]}`); } @@ -72,7 +72,7 @@ router.post("/search", (req, res) => { break; } - request.get(`/gbn/c/${inputConcepts[j]}`, (err3, response2, body2) => { + request.get(`${req.protocol}://${req.get("host")}/gbn/c/${inputConcepts[j]}`, (err3, response2, body2) => { if (response2.statusCode !== 200) { return res.status(418).send(`Could not interpret the concept: ${inputConcepts[j]}`); }