wiki-plugin-assets
Advanced tools
Comparing version 0.4.0 to 0.4.1-pre1
{ | ||
"name": "wiki-plugin-assets", | ||
"version": "0.4.0", | ||
"version": "0.4.1-pre1", | ||
"description": "Federated Wiki - Assets Plugin", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,2 +50,21 @@ "use strict"; | ||
}); | ||
app.get('/plugin/assets/index', cors, function (req, res) { | ||
var _walk; | ||
_walk = function walk(root) { | ||
return fs.readdirSync("".concat(argv.assets, "/").concat(root)).flatMap(function (name) { | ||
var path, stat; | ||
path = "".concat(root, "/").concat(name); | ||
stat = fs.statSync("".concat(argv.assets, "/").concat(path)); | ||
if (stat.isDirectory()) { | ||
return _walk(path); | ||
} else { | ||
return { | ||
file: path, | ||
size: stat.size | ||
}; | ||
} | ||
}); | ||
}; | ||
return res.json(_walk("")); | ||
}); | ||
app.post('/plugin/assets/upload', function (req, res) { | ||
@@ -52,0 +71,0 @@ var form; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
52669
371