Rewrite frontend as single self-contained HTML file — all CSS/JS inline, no external files to fail loading
This commit is contained in:
23
dist/server/routes/config.js
vendored
Normal file
23
dist/server/routes/config.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const express_1 = require("express");
|
||||
const jobStore_1 = require("../db/jobStore");
|
||||
const router = (0, express_1.Router)();
|
||||
router.get('/', (_req, res) => {
|
||||
const config = (0, jobStore_1.getAllConfig)();
|
||||
res.json({ config });
|
||||
});
|
||||
router.put('/', (req, res) => {
|
||||
const updates = req.body;
|
||||
if (typeof updates !== 'object' || updates === null) {
|
||||
res.status(400).json({ error: 'Body must be a JSON object of key-value pairs' });
|
||||
return;
|
||||
}
|
||||
for (const [key, value] of Object.entries(updates)) {
|
||||
(0, jobStore_1.setConfigValue)(key, String(value));
|
||||
}
|
||||
const config = (0, jobStore_1.getAllConfig)();
|
||||
res.json({ config });
|
||||
});
|
||||
exports.default = router;
|
||||
//# sourceMappingURL=config.js.map
|
||||
Reference in New Issue
Block a user