diff --git a/.env b/.env index 547228b99..feecca2a2 100644 --- a/.env +++ b/.env @@ -2,4 +2,4 @@ PORT = 3000 LOCAL_KEY=TCF25YM-39C4H6D-KA32EGF-V5XSHN3 RATE_LIMIT_WINDOW_SECONDS=60 RATE_LIMIT_MAX_CONNECTIONS=1000 -USE_AWS_CERT_FILE=true +useAWSCert=true diff --git a/src/index.js b/src/index.js index 72aa722a6..0667213b6 100644 --- a/src/index.js +++ b/src/index.js @@ -51,15 +51,19 @@ app.use((req, res, next) => { console.log('Checking for AWS cert file') const appEnv = process.env.NODE_ENV var awsCERTFile = false -if (process.env.USE_AWS_CERT) { - awsCERTFile = process.env.USE_AWS_CERT +if (process.env.useAWSCert) { + console.log('detecting env') + console.log(process.env.useAWSCert) + awsCERTFile = process.env.useAWSCert } else { awsCERTFile = config.has(`${appEnv}.useAWSCert`) ? config.get(`${appEnv}.useAWSCert`) : false + console.log('in if checker') + console.log(awsCERTFile) } // Connect to MongoDB database const dbConnectionStr = dbUtils.getMongoConnectionString() -if (awsCERTFile) { +if (awsCERTFile && appEnv != 'TEST') { const ca = [fs.readFileSync(path.join(__dirname, 'config/global-bundle.pem'))] mongoose.connect(dbConnectionStr, { useNewUrlParser: true,