From f542fb1bd7e9b1fb599a49049c40c96f4ac1a231 Mon Sep 17 00:00:00 2001 From: Marek Hrabe Date: Mon, 8 May 2017 12:33:56 -0400 Subject: [PATCH] fix config file shape, add instructions for getting a token --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5f2de3..7cdf11e 100644 --- a/README.md +++ b/README.md @@ -113,11 +113,32 @@ config.json file into `test/` folder like bellow: ```json { - "site": "", - "token": "" + "development": { + "site": "", + "token": "" + }, + "production": { + "site": "", + "token": "" + } } ``` +You can get your token using [the example app bundled with `wpcom-oauth`](https://github.com/Automattic/node-wpcom-oauth/tree/master/example) but make sure to edit the example to request the `global` scope (required by some tests). + +```diff +--- a/example/index.js ++++ b/example/index.js +@@ -30,7 +30,7 @@ app.set('view engine', 'jade'); + app.get('/', function(req, res){ + res.render('home', { + settings: settings, +- url: wpoauth.urlToConnect() ++ url: wpoauth.urlToConnect(undefined, { scope: 'global' }) + }); + }); +``` + Run tests: ```cli