mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
30 lines
624 B
JavaScript
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);
|
|
}; |