Skip to content

Commit

Permalink
made a few changes to get api to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
amyfromandi committed Sep 25, 2024
1 parent 58014c4 commit e52a592
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 10 additions & 8 deletions v2/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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=<url> 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'
};
}


Expand Down
4 changes: 1 addition & 3 deletions v2/larkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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'
Expand Down

0 comments on commit e52a592

Please sign in to comment.