Skip to content

Commit

Permalink
Fixed API uri.
Browse files Browse the repository at this point in the history
  • Loading branch information
ay0503 committed Nov 13, 2024
1 parent 0877353 commit 04c2a6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/translate/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

var request = require('request');

const translatorApi = module.exports;

translatorApi.translate = async function (postData) {
// Edit the translator URL below
const TRANSLATOR_API = "https://nodebb-f24-translator.azurewebsites.net/"
const response = await fetch(TRANSLATOR_API+'/?content='+postData.content);
const response = await fetch(TRANSLATOR_API + '/?content=' + postData.content);
const data = await response.json();
return [data["is_english"], data["translated_content"]]
}

0 comments on commit 04c2a6c

Please sign in to comment.