Skip to content
Snippets Groups Projects
Commit 102c8af8 authored by Nils Schneider's avatar Nils Schneider
Browse files

move config.js to config.json, load by XHR

parent 848b5b73
Branches
No related tags found
No related merge requests found
...@@ -37,9 +37,17 @@ Execute these commands on your server as a normal user to prepare the dependenci ...@@ -37,9 +37,17 @@ Execute these commands on your server as a normal user to prepare the dependenci
npm install bower grunt-cli npm install bower grunt-cli
node_modules/.bin/bower install node_modules/.bin/bower install
# Building
Just run the following command from the meshviewer directory:
node_modules/.bin/grunt
This will generate `build/` containing all required files.
# Configure # Configure
Copy `config.js.example` to `config.js` and change it to match your community. Copy `config.json.example` to `build/config.json` and change it to match your community.
## dataPath (string) ## dataPath (string)
...@@ -133,12 +141,4 @@ Examples for `globalInfos`: ...@@ -133,12 +141,4 @@ Examples for `globalInfos`:
In order to have global statistics available, you have to run the backend with parameter `--with-rrd` (this only creates globalGraph.png) or generate them in other ways. In order to have global statistics available, you have to run the backend with parameter `--with-rrd` (this only creates globalGraph.png) or generate them in other ways.
# Building
Just run the following command from the meshviewer directory:
node_modules/.bin/grunt
This will generate `build/` containing all required files.
[CORS enabled]: http://enable-cors.org/server.html [CORS enabled]: http://enable-cors.org/server.html
...@@ -32,5 +32,5 @@ require.config({ ...@@ -32,5 +32,5 @@ require.config({
}) })
require(["main", "helper"], function (main) { require(["main", "helper"], function (main) {
main() getJSON("config.json").then(main)
}) })
define({ {
"dataPath": "https://map.luebeck.freifunk.net/data/", "dataPath": "https://map.luebeck.freifunk.net/data/",
"siteName": "Freifunk Lübeck", "siteName": "Freifunk Lübeck",
"mapSigmaScale": 0.5, "mapSigmaScale": 0.5,
...@@ -18,4 +18,4 @@ define({ ...@@ -18,4 +18,4 @@ define({
"name": "Stamen.TonerLite" "name": "Stamen.TonerLite"
} }
] ]
}) }
define(["../config", "moment", "router", "leaflet", "gui", "numeral"], define(["moment", "router", "leaflet", "gui", "numeral"],
function (config, moment, Router, L, GUI, numeral) { function (moment, Router, L, GUI, numeral) {
return function () { return function (config) {
function handleData(data) { function handleData(data) {
var dataNodes = data[0] var dataNodes = data[0]
var dataGraph = data[1] var dataGraph = data[1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment