Get Post
This is an endpoint that gets a single post by slug. The actual endpoint is: "get/post/{slug}
". The type of the post is irrelevant.
It will return the post object, along with the author information (name and email).
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 postSlug = '...' | |
fetch(`www.mysite.com/api/get/post/${postSlug}`) | |
.then((blob) => { | |
return blob.json() | |
}) | |
.then((data) => { | |
console.log(data.content) | |
}) |