Set background client-side

This commit is contained in:
valadaptive
2023-12-15 05:43:27 -05:00
parent 7897206cf8
commit 0ee19d2ede
10 changed files with 64 additions and 55 deletions

View File

@@ -2,7 +2,6 @@ const fs = require('fs');
const path = require('path');
const express = require('express');
const sanitize = require('sanitize-filename');
const writeFileAtomicSync = require('write-file-atomic').sync;
const { jsonParser, urlencodedParser } = require('../express-common');
const { DIRECTORIES, UPLOADS_PATH } = require('../constants');
@@ -17,17 +16,6 @@ router.post('/all', jsonParser, function (request, response) {
});
router.post('/set', jsonParser, function (request, response) {
try {
const bg = `#bg1 {background-image: url('../backgrounds/${request.body.bg}');}`;
writeFileAtomicSync('public/css/bg_load.css', bg, 'utf8');
response.send({ result: 'ok' });
} catch (err) {
console.log(err);
response.send(err);
}
});
router.post('/delete', jsonParser, function (request, response) {
if (!request.body) return response.sendStatus(400);