This is the client-library for PBE, a free and easy-to-use headless CMS!
npm i @mawoka/pbeconst pbe = new PBE("https://your_pbe_install.test") // Note: There isn't a "/" at the end of the url // Get a single post via a slug const post = pbe.get_post("your_slug", false) // You can either get the HTML (false) or the markdown (true) // Now, check if the post isn't an error: if (isError(post)) { // Get the status_code the api returned: const code = post.http_status_code if (code === 404) { alert("Post not found") } else { alert("Unknown error!") } }
``` 3. Look at the API docs
Generated using TypeDoc