'use strict';

var path = require('path');
var nconf = require('nconf');

nconf.file({
  file: path.join(__dirname, '/../../settings.json')
});

var apiHost = process.env.OS_VIEWER_API_HOST || 'http://s145.okserver.org';
var authHost = process.env.OS_VIEWER_AUTH_HOST || 'http://s145.okserver.org';

// this is the object that you want to override in your own local config
nconf.defaults({
  env: process.env.NODE_ENV || 'development',
  debug: process.env.DEBUG || false,
  app: {
    port: process.env.PORT || 5000
  },
  api: {
    url: apiHost + '/api/3'
  },
  authLibraryUrl: authHost + '/permit/lib',
  basePath: process.env.OS_VIEWER_BASE_PATH || ''
});

module.exports = {
  get: nconf.get.bind(nconf),
  set: nconf.set.bind(nconf),
  reset: nconf.reset.bind(nconf)
};

@@ -67,16 +67,100 @@
 onf');%0A%0A
+const DEFAULT_HOST = 'http://next.openspending.org';%0Aconst DEFAULT_BASE_PATH = '';%0A%0A
 nconf.fi
@@ -274,34 +274,20 @@
  %7C%7C 
-'http://s145.okserver.org'
+DEFAULT_HOST
 ;%0Ava
@@ -338,34 +338,20 @@
  %7C%7C 
-'http://s145.okserver.org'
+DEFAULT_HOST
 ;%0A%0A/
@@ -704,18 +704,33 @@
 PATH %7C%7C 
-''
+DEFAULT_BASE_PATH
 %0A%7D);%0A%0Amo

Update default location of server.