Skip to content

Instantly share code, notes, and snippets.

@nwhitmont
Last active September 8, 2017 22:53
Show Gist options
  • Save nwhitmont/78d0830b8b6c358475ae93cd4b8a711b to your computer and use it in GitHub Desktop.
Save nwhitmont/78d0830b8b6c358475ae93cd4b8a711b to your computer and use it in GitHub Desktop.
// In your messages/index.js, wrap the returned function from connector.listen() with console.log override, shown below:
if (useEmulator) {
var restify = require('restify');
var server = restify.createServer();
server.listen(3978, function() {
console.log('test bot endpont at http://localhost:3978/api/messages');
});
server.post('/api/messages', connector.listen());
} else {
var listener = connector.listen();
var withLogging = function(context, req) {
console.log = context.log;
listener(context, req);
}
module.exports = { default: withLogging }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment