mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Set background client-side
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user