|
|
|
@ -6,7 +6,7 @@ var fs = require('fs');
|
|
|
|
|
var themesController = {};
|
|
|
|
|
|
|
|
|
|
themesController.get = function(req, res, next) {
|
|
|
|
|
var themeDir = path.join(__dirname, '../../node_modules/' + req.params.theme);
|
|
|
|
|
var themeDir = path.join(__dirname, '../../../node_modules/' + req.params.theme);
|
|
|
|
|
fs.exists(themeDir, function(exists) {
|
|
|
|
|
if (exists) {
|
|
|
|
|
var themeConfig = require(path.join(themeDir, 'theme.json')),
|
|
|
|
@ -14,7 +14,7 @@ themesController.get = function(req, res, next) {
|
|
|
|
|
if (themeConfig.screenshot && fs.existsSync(screenshotPath)) {
|
|
|
|
|
res.sendFile(screenshotPath);
|
|
|
|
|
} else {
|
|
|
|
|
res.sendFile(path.join(__dirname, '../../public/images/themes/default.png'));
|
|
|
|
|
res.sendFile(path.join(__dirname, '../../../public/images/themes/default.png'));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return next();
|
|
|
|
|