2014-05-12 20:08:19 +02:00
|
|
|
'use strict';
|
|
|
|
|
2014-06-06 23:00:32 +02:00
|
|
|
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: {
|
2014-06-06 23:00:32 +02:00
|
|
|
name: 'Freifunk Musterstadt',
|
|
|
|
domain: 'musterstadt.freifunk.net',
|
|
|
|
contactEmail: 'kontakt@musterstadt.freifunk.net'
|
2014-06-06 21:22:57 +02:00
|
|
|
},
|
|
|
|
map: {
|
2014-06-06 23:00:32 +02:00
|
|
|
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-06 23:00:32 +02:00
|
|
|
|
|
|
|
var configJSONFile = __dirname + "/../config.json";
|
|
|
|
var configJSON = undefined;
|
|
|
|
|
|
|
|
if (fs.existsSync(configJSONFile)) {
|
|
|
|
configJSON = JSON.parse(fs.readFileSync(configJSONFile, 'utf8'));
|
|
|
|
}
|
|
|
|
|
|
|
|
return deepExtend({}, defaultConfig, configJSON);
|
2014-05-12 20:08:19 +02:00
|
|
|
});
|