I want to change the inputLanguage that I input into the value 'en'. When I tried this method, the error that they return is english is not defined.
Here is my alchemy.js
module.exports = function(Alchemy) {
Alchemy.language = function(inText, inputLanguage, outputLanguage, cb) {
console.log('Input text is ' + inText);
console.log('Input language is ' + inputLanguage);
console.log('Output language is ' + outputLanguage);
getCode(inputLanguage, outputLanguage, cb);
}
Alchemy.remoteMethod(
'language', {
http: {
path: '/language',
verb: 'get'
},
accepts: [{
arg: 'inText',
type: 'string',
required: true
}, {
arg: 'inputLanguage',
type: 'string',
required: true
}, {
arg: 'outputLanguage',
type: 'string',
required: true
}],
returns: {
arg: 'results',
type: 'string'
}
}
);
function getCode(inputLanguage, outputLanguage, cb) {
if (inputLanguage = english) {
inLang = en;
console.log('Input language is ' + inlang)
}
}
};