mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-05 06:07:35 +02:00
refactor: shared constants (#8707)
define plugin name and theme name regexs in one location for consistency define various shared paths in one place for consistency
This commit is contained in:
@@ -4,13 +4,14 @@ const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const file = require('../../file');
|
||||
const { paths } = require('../../constants');
|
||||
|
||||
const themesController = module.exports;
|
||||
|
||||
const defaultScreenshotPath = path.join(__dirname, '../../../public/images/themes/default.png');
|
||||
|
||||
themesController.get = async function (req, res, next) {
|
||||
const themeDir = path.join(__dirname, '../../../node_modules', req.params.theme);
|
||||
const themeDir = path.join(paths.nodeModules, req.params.theme);
|
||||
const themeConfigPath = path.join(themeDir, 'theme.json');
|
||||
|
||||
let themeConfig;
|
||||
|
||||
Reference in New Issue
Block a user