Add way to download whole set

This commit is contained in:
2016-04-04 14:16:32 +02:00
parent 793d47914d
commit 0c9c536fda
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -1,2 +1,3 @@
data/
node_modules/
access.log
+6
View File
@@ -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;
}