adds index script

This commit is contained in:
Todd Treece 2015-07-27 17:53:38 -04:00
parent 7f2f7e1e4b
commit a7937e2de4

22
index.js Normal file
View file

@ -0,0 +1,22 @@
require('dotenv').load();
var API = require('./lib/api');
var NPR = API({
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET,
username: process.env.NPR_USERNAME,
password: process.env.NPR_PASSWORD
});
NPR.authenticate(function(err, token) {
if(err)
return console.error(err);
if(! token)
return console.error('invalid token');
console.log('Bearer ' + token);
});