Skip to content

Commit

Permalink
fix: include debugging for missing schema env
Browse files Browse the repository at this point in the history
  • Loading branch information
ZavenArra committed Dec 14, 2020
1 parent df2e9f6 commit 713ea9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions server/database/knex.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 713ea9e

Please sign in to comment.