mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-24 18:52:37 +03:00
18 lines
463 B
JavaScript
18 lines
463 B
JavaScript
const asyncWrapper = require('../../middleware/asyncWrapper');
|
|
const File = require('../../utils/File');
|
|
|
|
// @desc Get custom queries file
|
|
// @route GET /api/queries
|
|
// @access Public
|
|
const getQueries = asyncWrapper(async (req, res, next) => {
|
|
const file = new File('data/customQueries.json');
|
|
const content = JSON.parse(file.read());
|
|
|
|
res.status(200).json({
|
|
success: true,
|
|
data: content.queries,
|
|
});
|
|
});
|
|
|
|
module.exports = getQueries;
|