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 944fc71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 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=false
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
#version: '3'
services:
docdb:
# use a mongo image that most closely matches the DocumentDB API
Expand Down
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.toLocaleLowerCase() === 'true') {
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.toLocaleLowerCase() !== 'test') {
const ca = [fs.readFileSync(path.join(__dirname, 'config/global-bundle.pem'))]
mongoose.connect(dbConnectionStr, {
useNewUrlParser: true,
Expand Down

0 comments on commit 944fc71

Please sign in to comment.