Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LastSymphony12 authored Nov 13, 2024
1 parent 880c853 commit 27e2a1a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/translate/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
var request = require('request');
'use strict';
const request = require('request');

const translatorApi = module.exports;

translatorApi.translate = async function (postData) {
// Edit the translator URL below
const TRANSLATOR_API = 'https://webapptranslatorservice.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']];
}
return [data.is_english, data.translated_content];
};

0 comments on commit 27e2a1a

Please sign in to comment.