From 713ea9ea69768818f97707a619976dbeec0b76d9 Mon Sep 17 00:00:00 2001 From: Zaven Date: Mon, 14 Dec 2020 15:35:34 -0800 Subject: [PATCH] fix: include debugging for missing schema env --- server/database/knex.js | 4 ++++ server/server.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/database/knex.js b/server/database/knex.js index fb11ece0..03de907a 100644 --- a/server/database/knex.js +++ b/server/database/knex.js @@ -1,6 +1,7 @@ const expect = require('expect-runtime'); const connection = require('../../config/config').connectionString; expect(connection).to.match(/^postgresql:\//); +const log = require("loglevel"); let knexConfig = { client: 'pg', @@ -9,9 +10,12 @@ let knexConfig = { pool: { min:0, max: 100}, } +log.debug('hello') +log.info(process.env.DATABASE_SCHEMA) if(process.env.DATABASE_SCHEMA){ knexConfig.searchPath = [process.env.DATABASE_SCHEMA] } +log.info(knexConfig.searchPath) const knex = require('knex')(knexConfig); diff --git a/server/server.js b/server/server.js index e4d928ef..21a5cb04 100644 --- a/server/server.js +++ b/server/server.js @@ -1,9 +1,9 @@ require('dotenv').config() -const app = require("./app"); -//set the log level +const log = require("loglevel"); +//setup log level require("./setup"); +const app = require("./app"); const port = process.env.NODE_PORT || 3006; -const log = require("loglevel"); app.listen(port,()=>{ log.info('listening on port:' + port);