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:

let postSlug = '...'
fetch(`www.mysite.com/api/get/post/${postSlug}`)
.then((blob) => {
return blob.json()
})
.then((data) => {
console.log(data.content)
})
view raw get-post.js hosted with ❤ by GitHub