Get WordPress data from REST API
function getData(){ | |
context.log('get data'); | |
var options = { | |
url: 'https://windowsarea.de/wp-json/wp/v2/posts', | |
method: 'GET', | |
json: true | |
} | |
request(options, function (error, response, data) { | |
context.log("request callback"); | |
if (error) { | |
context.log(error); | |
} | |
else { | |
context.log(data.length); | |
mynews = data; | |
} | |
prepareTemplates(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment