From aea38433a40b89afc02cf5503863a70d14cfafe7 Mon Sep 17 00:00:00 2001 From: Amy Fromandi Date: Mon, 9 Sep 2024 17:00:54 -0500 Subject: [PATCH] testing elevation endpoint on dev --- v2/credentials.ts | 7 ------- v2/larkin.ts | 9 ++++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/v2/credentials.ts b/v2/credentials.ts index 0f0aa432..7748265e 100644 --- a/v2/credentials.ts +++ b/v2/credentials.ts @@ -7,13 +7,6 @@ exports.pg = { database: process.env.database }; -exports.elevationDatabase = { - host: process.env.host, - port: process.env.port, - user: process.env.user, - password: process.env.password, - database: process.env.database -}; diff --git a/v2/larkin.ts b/v2/larkin.ts index ced1f113..ccaf4178 100644 --- a/v2/larkin.ts +++ b/v2/larkin.ts @@ -81,15 +81,14 @@ const { Client, Pool } = require("pg"); "In Macrostrat v2, 'geomacro' is merged with 'burwell' into the 'macrostrat' database.", ); } + let connectionDetails = credentials.pg; if (dbName == "elevation") { /* Special case for elevation database (temporary) */ - let { connectionString, ...otherConnectionDetails } = credentials.elevationDatabase; - } else { - let { connectionString, ...otherConnectionDetails } = credentials.pg; + connectionDetails.database = 'elevation' } - - const pool = new Pool({ connectionString, ...otherConnectionDetails }); + console.log(connectionDetails) + const pool = new Pool(connectionDetails); pool.connect(function (err, client, done) { if (err) {