Skip to content

Commit

Permalink
Merge pull request #53 from nuxt-community/fix-config-set
Browse files Browse the repository at this point in the history
fix: properly set config so it dont complain about invalid key on server
  • Loading branch information
aldarund authored Aug 31, 2022
2 parents 0a1ffa1 + 132557a commit c7382fc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ module.exports = function appInsights (moduleOptions) {
logger.info('Server errors will not be logged because no serverConnectionString provided')
return
}

const appInsightsServer = AppInsights.setup(optionsServer.serverConnectionString)
const config = { ...AppInsights.defaultClient.config, ...optionsServer.serverConfig }

AppInsights.defaultClient.config = config
// Initialize AppInsights
for (const [key, value] of Object.entries(optionsServer.serverConfig)) {
AppInsights.defaultClient.config[key] = value
}

if (optionsServer.initialize) {
appInsightsServer.start()
}
Expand Down

0 comments on commit c7382fc

Please sign in to comment.