Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
raissg committed Nov 12, 2024
1 parent e9d2c50 commit f6c385b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/translate/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var request = require('request');
'use strict';

const translatorApi = module.exports;

translatorApi.translate = async function (postData) {
// Edit the translator URL below
const TRANSLATOR_API = "https://translator-swifites.azurewebsites.net/"
const response = await fetch(TRANSLATOR_API+'/?content='+postData.content);
const data = await response.json();
return [data["is_english"], data["translated_content"]]
}
// Edit the translator URL below
const TRANSLATOR_API = 'https://translator-swifites.azurewebsites.net/';
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 f6c385b

Please sign in to comment.