Stage after merging with project files
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { Router } from 'express';
|
||||
|
||||
import {
|
||||
getAppConfig,
|
||||
getExportProfile,
|
||||
getImageRules
|
||||
} from '../services/configService.js';
|
||||
import { asyncHandler } from '../utils/asyncHandler.js';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get(
|
||||
'/image-rules',
|
||||
asyncHandler(async (_req, res) => {
|
||||
const imageRules = await getImageRules();
|
||||
|
||||
if (!imageRules) {
|
||||
return res.status(404).json({ message: 'Image rules not found.' });
|
||||
}
|
||||
|
||||
res.json(imageRules);
|
||||
})
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/export',
|
||||
asyncHandler(async (_req, res) => {
|
||||
const exportProfile = await getExportProfile();
|
||||
|
||||
if (!exportProfile) {
|
||||
return res.status(404).json({ message: 'Export profile not found.' });
|
||||
}
|
||||
|
||||
res.json(exportProfile);
|
||||
})
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/app-config',
|
||||
asyncHandler(async (_req, res) => {
|
||||
const config = await getAppConfig();
|
||||
res.json({ items: config });
|
||||
})
|
||||
);
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user