From b8ad5bbb094056360be1a28d3bf3a391d61ec353 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Mon, 30 Sep 2019 21:00:24 -0700 Subject: [PATCH] chore: update database ENV keys --- site/.env.example | 9 +++++++-- site/src/utils/db.js | 5 ++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/site/.env.example b/site/.env.example index 4de2f6111a..9cfe50cd6c 100644 --- a/site/.env.example +++ b/site/.env.example @@ -2,7 +2,12 @@ NODE_ENV= PORT= BASEURL= -DATABASE_URL= GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= -MAPBOX_ACCESS_TOKEN= \ No newline at end of file +MAPBOX_ACCESS_TOKEN= + +PGHOST=hostname +PGPORT=port +PGUSER=username +PGPASSWORD=password +PGDATABASE=database_name diff --git a/site/src/utils/db.js b/site/src/utils/db.js index a4d398e181..ba9d5e4066 100644 --- a/site/src/utils/db.js +++ b/site/src/utils/db.js @@ -1,8 +1,7 @@ import { Pool } from 'pg'; -export const DB = new Pool({ - connectionString: process.env.DATABASE_URL -}); +// Uses `PG*` ENV vars +export const DB = new Pool(); export function query(text, values=[]) { return DB.query(text, values).then(r => r.rows);