mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
New server route to fetch config
Added a new route to the Express server to supply client with config. Removed the original 'cookie' hack
This commit is contained in:
@@ -52,6 +52,10 @@ var Server = function(config, callback) {
|
||||
res.send(global.version);
|
||||
});
|
||||
|
||||
app.get("/config", function(req,res) {
|
||||
res.send(config);
|
||||
});
|
||||
|
||||
app.get("/", function(req, res) {
|
||||
var html = fs.readFileSync(path.resolve(global.root_path + "/index.html"), {encoding: "utf8"});
|
||||
html = html.replace("#VERSION#", global.version);
|
||||
@@ -62,9 +66,6 @@ var Server = function(config, callback) {
|
||||
}
|
||||
html = html.replace("#CONFIG_FILE#", configFile);
|
||||
|
||||
// Set a temporary cookie called "config" to the JSON encoded config object
|
||||
res.cookie("config", JSON.stringify(config));
|
||||
|
||||
res.send(html);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user