Skip to content

Commit

Permalink
Minor fix var->let to maintain code style
Browse files Browse the repository at this point in the history
  • Loading branch information
nh602 committed Feb 25, 2024
1 parent e492f1b commit feb38b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/database.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Import the pg-promise library and initialize it
const pgp = require('pg-promise')();

var db;
let db;

if (process.env.NODE_ENV === undefined) {
throw new Error('NODE_ENV environment variable not set');
Expand All @@ -13,11 +13,11 @@ if (process.env.DATABASE_URL === undefined || process.env.DATABASE_TEST_URL ===
// Connect to the database using the environment variable DATABASE_URL
if (process.env.NODE_ENV === 'test') {
console.log('Connecting to database using url: ' + process.env.DATABASE_TEST_URL);
var db = pgp(process.env.DATABASE_TEST_URL);
db = pgp(process.env.DATABASE_TEST_URL);
}
else {
console.log('Connecting to database using url: ' + process.env.DATABASE_URL);
var db = pgp(process.env.DATABASE_URL);
db = pgp(process.env.DATABASE_URL);
}

/*
Expand Down

0 comments on commit feb38b4

Please sign in to comment.