diff --git a/app.js b/app.js index 8ba0bf71..fe2ca1db 100644 --- a/app.js +++ b/app.js @@ -1,3 +1,4 @@ +require('newrelic'); const bodyParser = require('body-parser'); const compression = require('compression'); const getConfig = require("./config"); @@ -107,10 +108,6 @@ app.use(function(err, req, res) { // start the server, but only if we're not in the middle of a test if(!module.parent) { - if(config.prod_envs.includes(process.env.NODE_ENV)) { - require('newrelic'); - } - app.listen(config.PORT, () => logger.info(`Started API server at http://0.0.0.0:${config.PORT}/`)); } diff --git a/newrelic.js b/newrelic.js index 15955e5c..3cda2521 100644 --- a/newrelic.js +++ b/newrelic.js @@ -10,7 +10,7 @@ exports.config = { /** * Array of application names. */ - app_name: ['code-api-dev', 'code-api-staging', 'code-api'], + app_name: [process.env.NEW_RELIC_APP_NAME, 'code-api'], /** * Your New Relic license key. */