This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module: ./lib/logger | |
--------------------------- | |
// load config file (would like this to be passed in to the constructor) | |
nconf.file({ file: fileConfig}); | |
var logSetting = nconf.get('log'); | |
// instantiate the logger | |
var log = new Bunyan({ | |
name: logSetting.name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remote API call | |
function asyncFunction2(x,callback ) { | |
var request = require('request'); | |
var url = 'http://www.google.com'; | |
request(url, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
console.log('completing transformation of '+x+'^2 = '+x*x); | |
callback(null, x); | |
} |