Basic news website build with Node.js, Express & EJS – WP Rest API
Website is live on https://news-website-l09b.onrender.com/
The data for the articles will come from a no-auth newsapi.
API_URL= https://raddy.dev/wp-json/wp/v2/posts/
Go through the documentation to see the detailed version of how to use this API.
initialise the project
$ npm initinstall all the dependencies
$ npm i express axios body-parser ejsinstall the nodemon
$ npm i --save-dev nodemonstart our local server
$ nodemon index.jsImportant API urls are
https://raddy.dev/wp-json/wp/v2/posts/
https://raddy.dev/wp-json/wp/v2/posts?search=photoshop
https://raddy.dev/wp-json/wp/v2/posts/5372
https://raddy.dev/wp-json/wp/v2/posts?_embed
_embeded gives you more data to work with.