Create a gist now

Instantly share code, notes, and snippets.

@ahmadawais /wp.js Secret
Created May 21, 2018

Embed
What would you like to do?
wp.js
var WP = require( 'wordpress-rest-api' );
var _ = require( 'lodash' );
var config = _.pick( require( './config' ).wordpress, [
// Whitelist valid config keys
'username',
'password',
'endpoint'
]);
var wp = new WP( config );
module.exports = wp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment