Add way to download whole set
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
|
data/
|
||||||
node_modules/
|
node_modules/
|
||||||
access.log
|
access.log
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module.exports = function(set, app, data, scriptMethods) {
|
|||||||
var keys = Object.keys(set.generators);
|
var keys = Object.keys(set.generators);
|
||||||
var cache = {};
|
var cache = {};
|
||||||
var defaultKey = null;
|
var defaultKey = null;
|
||||||
|
var setJson = JSON.stringify(set.export());
|
||||||
|
|
||||||
for(var i = 0; i < keys.length; ++i) {
|
for(var i = 0; i < keys.length; ++i) {
|
||||||
var bindObj = {key: keys[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() {
|
scriptMethods.getDefaultDataKey = function() {
|
||||||
return defaultKey;
|
return defaultKey;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user