Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active May 10, 2020 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanaf1979/ed8259ef84c7420a5a389f79995b2929 to your computer and use it in GitHub Desktop.
Save vanaf1979/ed8259ef84c7420a5a389f79995b2929 to your computer and use it in GitHub Desktop.
/*
* 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