Bring in the WP API library to make it easy to pull data from sites

parent 793dbc85
'use strict'; 'use strict';
var express = require( 'express' ); var express = require( 'express' );
var wpapi = require( 'wpapi' );
var app = express(); var app = express();
// Only one route // Only one route
app.get( '/', function( req, res ) { app.get( '/', function( req, res ) {
res.send( 'Hello World!' ); res.send( 'Hello World' );
} ); } );
// Listen on some random, unused port // Listen on some random, unused port
......
{ {
"name": "eth-landing-page", "name": "eth-landing-page",
"version": "0.1.0", "version": "0.1.0",
"description": "Retrieve latest posts from various sites using the WP REST API and display them on a landing page", "description": "Retrieve latest posts from various sites using the WP REST API and display them as a landing page",
"author": "Erick Hitter <contact@ethitter.com>", "author": "Erick Hitter <contact@ethitter.com>",
"license": "GPL-2.0+", "license": "GPL-2.0+",
"main": "index.js", "main": "index.js",
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
"start": "node index.js" "start": "node index.js"
}, },
"dependencies": { "dependencies": {
"express": "*" "express": "*",
"wpapi": "*"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment