ffffng/server/config.js

47 lines
1.3 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: {
baseUrl: 'http://localhost:8080',
2014-06-06 21:22:57 +02:00
port: 8080,
2016-05-20 22:11:35 +02:00
peersPath: '/tmp/peers',
email: {
from: 'no-reply@musterstadt.freifunk.net'
}
2014-06-06 21:22:57 +02:00
},
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
},
monitoring: {
enabled: true
},
2014-06-06 21:22:57 +02:00
coordsSelector: {
showInfo: false,
showBorderForDebugging: false,
localCommunityPolygon: [],
2014-06-06 21:22:57 +02:00
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
});