Mercurial > pumpbridge
diff src/config.coffee @ 0:b73191efc65b
Initial import of pumpbridge (bloody bloody alpha)
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Thu, 05 Jun 2014 10:35:15 +0200 |
parents | |
children | 98a070c98982 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/config.coffee Thu Jun 05 10:35:15 2014 +0200 @@ -0,0 +1,31 @@ +# Copyright (C) 2014 by Intevation GmbH +# Author: Mathias Gebbe <mgebbe@intevation.de> +# +# This file is Free Software under the Apache License, Version 2.0 +# (the "License"); and comes with ABSOLUTELY NO WARRANTY! +# You may not use this file except in compliance with the License. +# See LICENSE for details. + +fs = require 'fs' +path = require 'path' +_ = require("underscore") + +filename = '/etc/pumpbridge.json' + +defaults = + name: 'pumpbridge' + description: 'bridge it' + forwardInterval: 15 * 60 * 1000 + updateInterval: 12 * 60 * 60 * 1000 + params: {} + views: path.join(__dirname, '..', 'views') + static: path.join(__dirname, '..', 'public') + foreign: 'pumpbridge' + foreignName: null + +if fs.existsSync(filename) + config = _.defaults(JSON.parse(fs.readFileSync(filename)), defaults) +else + config = defaults + +exports.config = config