diff --git a/samples/javascript_nodejs/20.qna-with-appinsights/index.js b/samples/javascript_nodejs/20.qna-with-appinsights/index.js index 29fc53795e..582f315de8 100644 --- a/samples/javascript_nodejs/20.qna-with-appinsights/index.js +++ b/samples/javascript_nodejs/20.qna-with-appinsights/index.js @@ -41,6 +41,7 @@ const APP_INSIGHTS_CONFIGURATION = 'appInsights'; // Get bot endpoint configuration by service name. const endpointConfig = botConfig.findServiceByNameOrId(BOT_CONFIGURATION); const qnaConfig = botConfig.findServiceByNameOrId(QNA_CONFIGURATION); + const appInsightsConfig = APP_INSIGHTS_CONFIGURATION ? botConfig.findServiceByNameOrId(APP_INSIGHTS_CONFIGURATION) @@ -103,6 +104,7 @@ let server = restify.createServer(); // Enable the Application Insights middleware, which helps correlate all activity // based on the incoming request. +server.use(restify.plugins.bodyParser()); server.use(ApplicationInsightsWebserverMiddleware); server.listen(process.env.port || process.env.PORT || 3978, function() { diff --git a/samples/javascript_nodejs/21.luis-with-appinsights/index.js b/samples/javascript_nodejs/21.luis-with-appinsights/index.js index 172ac49fb8..2560d25a4f 100644 --- a/samples/javascript_nodejs/21.luis-with-appinsights/index.js +++ b/samples/javascript_nodejs/21.luis-with-appinsights/index.js @@ -116,6 +116,7 @@ let server = restify.createServer(); // Enable the Application Insights middleware, which helps correlate all activity // based on the incoming request. +server.use(restify.plugins.bodyParser()); server.use(ApplicationInsightsWebserverMiddleware); server.listen(process.env.port || process.env.PORT || 3978, function() {