ffffng/server/config.js

36 lines
1 KiB
JavaScript
Raw Normal View History

2014-05-12 20:08:19 +02:00
'use strict';
angular.module('ffffng').factory('config', function (fs, deepExtend) {
var defaultConfig = {
2014-06-06 21:22:57 +02:00
server: {
port: 8080,
peersPath: '/tmp/peers'
},
client: {
community: {
name: 'Freifunk Musterstadt',
domain: 'musterstadt.freifunk.net',
contactEmail: 'kontakt@musterstadt.freifunk.net'
2014-06-06 21:22:57 +02:00
},
map: {
graphUrl: 'http://graph.musterstadt.freifunk.net/graph.html',
mapUrl: 'http://graph.musterstadt.freifunk.net/geomap.html'
2014-06-06 21:22:57 +02:00
},
coordsSelector: {
lat: 53.565278,
lng: 10.001389,
defaultZoom: 10
}
}
2014-05-12 20:08:19 +02:00
};
2014-06-14 00:51:54 +02:00
var configJSONFile = __dirname + '/../config.json';
var configJSON = {};
if (fs.existsSync(configJSONFile)) {
configJSON = JSON.parse(fs.readFileSync(configJSONFile, 'utf8'));
}
return deepExtend({}, defaultConfig, configJSON);
2014-05-12 20:08:19 +02:00
});