Skip to content

Commit

Permalink
Make server configuration work by instatiating a separate instance of…
Browse files Browse the repository at this point in the history
… nconf
  • Loading branch information
vikoivun committed Dec 4, 2017
1 parent aaf3725 commit 157d453
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/getSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ const defaults = {
const configKeys = ["port", "publicUrl", "helsinkiAuthId", "helsinkiAuthSecret", "helsinkiTargetApp", "sessionSecret"];

export default function getOptions() {
const nconf = require('nconf');
let nconf = require('nconf');
// We do not want the singleton, as webpack conf also uses nconf
// with its own defaults
nconf = new nconf.Provider();

nconf.env(configKeys)
nconf.defaults(defaults)
if(process.env.NODE_ENV == 'development') {
nconf.file({file: 'config_dev.json'})
}
nconf.defaults(defaults);

nconf.required(configKeys)

Expand Down

0 comments on commit 157d453

Please sign in to comment.