1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-23 21:29:37 +02:00

Added theme string normalization to initial process. Added getThemes controller

This commit is contained in:
Paweł Malak 2022-03-23 14:13:14 +01:00
parent ee0b435493
commit e427fbf54c
6 changed files with 310 additions and 0 deletions

View file

@ -0,0 +1,17 @@
const asyncWrapper = require('../../middleware/asyncWrapper');
const File = require('../../utils/File');
// @desc Get themes file
// @route GET /api/themes
// @access Public
const getThemes = asyncWrapper(async (req, res, next) => {
const file = new File('data/themes.json');
const content = JSON.parse(file.read());
res.status(200).json({
success: true,
data: content.themes,
});
});
module.exports = getThemes;