From 36449c933b628c6207f100b46f1eeef10343c6ff Mon Sep 17 00:00:00 2001 From: Matthew Berryman Date: Wed, 8 Feb 2017 08:48:26 +1100 Subject: [PATCH] fix PGUSERNAME->PGUSER env var --- README.md | 2 +- sample.env | 2 +- src/db.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 89aa86b..6697d5f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Server configuration parameters are stored in a configuration file which is pars * `PGPORT`: Postgres DB port (default: `5432`) * `PGSSL`: SSL enabled on Postgres DB connection? (default: `false`) * `PGTIMEOUT`: Max duration on DB calls before timeout (in milliseconds) (default: `5000` i.e. 5 seconds) -* `PGUSERNAME`: Postgres DB username (default: `postgres`) +* `PGUSER`: Postgres DB username (default: `postgres`) * `FORMAT_DEFAULT`: Which format to return results in by default (default: `json`) * `FORMATS`: Formats supported by the system (as comma separated list) (default: `json,xml`) * `GEO_FORMAT_DEFAULT`: Which format to return geographic results in by default (default: `topojson`) diff --git a/sample.env b/sample.env index ad86cd9..2e22d0d 100644 --- a/sample.env +++ b/sample.env @@ -2,7 +2,7 @@ AUTH0_CLIENT_ID=auth0_client_id_goes_here AUTH0_SECRET=auth0_secret_goes_here PGHOST=127.0.0.1 PGPORT=5432 -PGUSERNAME=cognicity +PGUSER=cognicity PGPASSWORD=PGPASSWORD_goes_here PGDATABASE=cognicity LOG_DIR=/tmp/cognicity diff --git a/src/db.js b/src/db.js index b5207d9..816fc87 100755 --- a/src/db.js +++ b/src/db.js @@ -9,7 +9,7 @@ const pgp = require('pg-promise')({ export default (config, logger) => new Promise((resolve, reject) => { // Build the connection string - const cn = `postgres://${config.PGUSERNAME}:${config.PGPASSWORD}@${config.PGHOST}:${config.PGPORT}/${config.PGDATABASE}?ssl=${config.PGSSL}`; + const cn = `postgres://${config.PGUSER}:${config.PGPASSWORD}@${config.PGHOST}:${config.PGPORT}/${config.PGDATABASE}?ssl=${config.PGSSL}`; logger.debug(cn); // Setup the connection