Hi everyone,
i have a problem figuring out how to use the context.async function …
i’m using a library, server-side, whose main function is read(url, function (err, article, meta) {...});
i’m writing the following (but with no success) (in the run_server:
function) :
function(properties, context) {
var read = require('node-readability');
return context.async(async callback => {
try {
var res = await read(properties.url, function(err, article, meta) {
var html = article.html;
var text = article.content;
article.close();
return {
html_body :html,
content: text
}
});
callback(undefined, res);
}
catch ( err ) {
callback( err );
}
});
}
And i can’t figure out what it doesn’t work …
Thanks for any help