From feb38b42e545cfcbbf7e8c5d3abaf7f2197a3d86 Mon Sep 17 00:00:00 2001 From: nh602 Date: Sun, 25 Feb 2024 22:25:44 +0000 Subject: [PATCH] Minor fix var->let to maintain code style --- backend/database.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/database.js b/backend/database.js index f22ed02..174688b 100644 --- a/backend/database.js +++ b/backend/database.js @@ -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'); @@ -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); } /*