Skip to content

Decoupled WordPress: A basic example of a Node.js app using WordPress / WP REST API endpoints for the data source. Matt Mullenweg referred to this as a "reverse mullet" at WordCampUS 2015. Party up front. Business out back.

License

Notifications You must be signed in to change notification settings

michaelck/Node-with-WordPress-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node-with-WordPress-REST-API

A basic example of a Node.js app using WordPress / WP REST API endpoints for the data source. Matt Mullenweg referred to this as a "reverse mullet" at WordCampUS 2015. Party up front. Business out back.

Requirements

  • WordPress (minimum v4.4) running the WP REST API v2 plugin
  • Node.js. The following modules are required:
    • Express - Application framework
    • Jade - Node template language
    • Path - utilities for handling and transforming file paths
    • HTTP

Getting up and running

  • Download or clone this repository
  • Navigate to the repository directory in the terminal
  • Run npm install
  • Create a config file with the following command: touch config.js
  • Modify the following sample to meet your needs and add it to your config.js file:
var config = {};

//Be sure to omit the protocol (in this case 'http') from wpURL value
config.wpUrl = 'www.example.com';
config.listen = 3000;

module.exports = config;

Example Routes

Returns all public posts on a WordPress site.

Returns a single public WordPress post

About

Decoupled WordPress: A basic example of a Node.js app using WordPress / WP REST API endpoints for the data source. Matt Mullenweg referred to this as a "reverse mullet" at WordCampUS 2015. Party up front. Business out back.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published