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:
parent
ee0b435493
commit
e427fbf54c
6 changed files with 310 additions and 0 deletions
17
controllers/themes/getThemes.js
Normal file
17
controllers/themes/getThemes.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue