Skip to content

Commit

Permalink
unify names
Browse files Browse the repository at this point in the history
  • Loading branch information
david-rocca committed Oct 22, 2024
1 parent 4a98eeb commit d50ecd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d50ecd0

Please sign in to comment.