Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
* Import local dependencies
*/
import Api from './api.js';
/*
* Use the Axios Api object to call the /wp/v2/posts
* endpoint and retrieve the 10 latest posts.
*/
Api.get('/wp/v2/posts', {}).then(function (response) {
console.log(response.data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.