From e52a592c278f425f880ee7f2eea27ef0a17b10fd Mon Sep 17 00:00:00 2001 From: Amy Fromandi Date: Wed, 25 Sep 2024 13:18:30 -0500 Subject: [PATCH] made a few changes to get api to deploy --- v2/credentials.ts | 18 ++++++++++-------- v2/larkin.ts | 4 +--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/v2/credentials.ts b/v2/credentials.ts index 123fde3b..48a4d920 100644 --- a/v2/credentials.ts +++ b/v2/credentials.ts @@ -11,15 +11,17 @@ if (process.env.MACROSTRAT_DATABASE != null) { macrostratDatabaseURL, elevationDatabaseURL }; -} else { +} +//added exports.pg to https://github.com/UW-Macrostrat/tiger-macrostrat-config/blob/main/manifests/development/dev-web-stack/credentials.js +else { console.warn("Using deprecated database configuration, please migrate to the MACROSTRAT_DATABASE= format"); - exports.pg = { - host: process.env.host, - port: process.env.port, - user: process.env.user, - password: process.env.password, - database: process.env.database - }; +exports.pg = { + host: process.env.host, + port: process.env.port, + user: process.env.user, + password: process.env.password, + database: 'macrostrat' +}; } diff --git a/v2/larkin.ts b/v2/larkin.ts index 010c46a6..6474e3b9 100644 --- a/v2/larkin.ts +++ b/v2/larkin.ts @@ -82,9 +82,7 @@ const { Client, Pool } = require("pg"); } let connectionDetails; - const postgresCfg = credentials.pg; - console.log(postgresCfg.elevationDatabaseURL) const inURLMode = postgresCfg.macrostratDatabaseURL != null; if (inURLMode) { @@ -95,7 +93,7 @@ const { Client, Pool } = require("pg"); connectionDetails = { connectionString } } else { - connectionDetails = {...credentials.pg} + connectionDetails = { ...credentials.pg } if (dbName == "elevation") { /* Special case for elevation database (temporary) */ connectionDetails.database = 'elevation'