arma-server-web-admin/routes/mods.js
2014-04-04 08:37:43 +00:00

30 lines
624 B
JavaScript

var fs = require('fs');
var config = require('./../config');
exports.index = function(req, res){
fs.readdir(config.path, function (err, files) {
if (err) {
res.send(err);
} else {
var mods = files.filter(function (file) {
return file.charAt(0) == "@";
}).map(function (mod) {
return { name: mod }
});
res.send(mods);
}
});
};
exports.create = function(req, res){
res.send('create mod');
};
exports.show = function(req, res){
res.send('show mod ' + req.params.mod);
};
exports.destroy = function(req, res){
res.send('destroy mod ' + req.params.mod);
};