Skip to content

Commit

Permalink
Made some changes to get variables working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kenlight-bu committed Sep 27, 2024
1 parent 42f3012 commit 4f76ef5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions code/server/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
const mongoose = require('mongoose')
const dotenv = require('dotenv');

// Load the appropriate .env file based on NODE_ENV
//NODE_ENV is set via package.json

// Determine the correct .env file based on the environment
const envFile = process.env.NODE_ENV === 'production' ? '.env.production' : '.env.development';

// Load the appropriate .env file
dotenv.config({ path: '../${envFile}' }); // Adjust the path as necessary based on your directory structure
dotenv.config({ path: `../${envFile}` });


let connection = null
Expand Down

0 comments on commit 4f76ef5

Please sign in to comment.