Get Page of Posts
This will retrieve a set number of posts of a given type. The number of posts returned is determined in the "config.php" file with the PAGE_SIZE
variable.
The endpoint for this one is "get/page/{post_type}/{page_number}
"
Example:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let postType = '...' | |
let pageNum = 0 | |
fetch(`www.mysite.com/api/get/page/${postType}/${pageNum}`) | |
.then((blob) => { | |
return blob.json() | |
}) | |
.then((data) => { | |
console.log(data.content) | |
}) |