Browse Source

Add way to download whole set

master
Gisle Aune 8 years ago
parent
commit
0c9c536fda
  1. 1
      .gitignore
  2. 6
      scripts/data.js

1
.gitignore

@ -1,2 +1,3 @@
data/
node_modules/
access.log

6
scripts/data.js

@ -2,6 +2,7 @@ module.exports = function(set, app, data, scriptMethods) {
var keys = Object.keys(set.generators);
var cache = {};
var defaultKey = null;
var setJson = JSON.stringify(set.export());
for(var i = 0; i < keys.length; ++i) {
var bindObj = {key: keys[i]}
@ -27,6 +28,11 @@ module.exports = function(set, app, data, scriptMethods) {
}
}
app.get('/d/set', function(req, res) {
res.header("Content-Type", "application/json; charset=utf-8");
res.end(setJson);
});
scriptMethods.getDefaultDataKey = function() {
return defaultKey;
}

Loading…
Cancel
Save