A node api client for rooftop cms
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.doclets.yml
.editorconfig
.gitignore
.npmignore
.travis.yml
LICENSE.md
README.md
contributing.md
package.json
yarn.lock tests > rooftop-seeds Oct 24, 2016

README.md

rooftop

npm tests dependencies

node api client for Rooftop CMS

Note: This project is in early development, and versioning is a little different. Read this for more details.

Installation

npm i rooftop-client -S

Note: This project only supports Node 6+

Usage

const Rooftop = require('rooftop-client')

const api = Rooftop.new({
  url: 'https://yoursubdomain.rooftopcms.io',
  apiToken: 'xxx'
})

// get all posts
api.posts.get().then(console.log)

// get all case studies (custom field example)
api.caseStudies.get().then(console.log)

// get the first 5 posts
api.posts.get(5).then(console.log)

// get only posts with content matching the search query
// see http://v2.wp-api.org/reference/posts/ for possible params
api.posts.get({ params: { search: 'hello' } }).then(console.log)

Testing

This project uses the rooftop-seeds project, which is a hosted rooftop instance with a public read-only key used specifically for testing OSS products that rely on rooftop. Please do not abuse this free service.

If any changes are needed to the test data in order to properly test a new feature, please file an issue and we will make the changes as required!

License & Contributing