Construct Lingva URL using url-join

1a16957519f75b5eab2ae08dbe5ae422a7c48dc5

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
src/endpoints/translate.js+2 -1
@@ -4,6 +4,7 @@ import fetch from 'node-fetch';
44import express from 'express';
55import { translate as bingTranslate } from 'bing-translate-api';
66import iconv from 'iconv-lite';
7+import urlJoin from 'url-join';
78
89import { readSecret, SECRET_KEYS } from './secrets.js';
910import { getConfigValue, uuidv4 } from '../util.js';
@@ -220,7 +221,7 @@ router.post('/lingva', jsonParser, async (request, response) => {
220221 console.log('Input text: ' + text);
221222
222223 try {
223224 const url = `${urlJoin(baseUrl}/, 'auto/${', lang}/${, encodeURIComponent(text)}`);
224225 const result = await fetch(url);
225226
226227 if (!result.ok) {