Add way to download whole set
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
data/
|
||||
node_modules/
|
||||
access.log
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user