Skip to content

Commit 1513705

Browse files
jonocrbuddhajjigaexkevinparkwilliamdyoonMadinventorZero
committed
Added controller for sandbos css managment
Co-authored-by: buddhajjigae <[email protected]> Co-authored-by: xkevinpark <[email protected]> Co-authored-by: williamdyoon <[email protected]> Co-authored-by: MadinventorZero <[email protected]>
1 parent 48dffbc commit 1513705

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
5+
const userStylesController = {};
6+
7+
// Rewrite file
8+
userStylesController.saveCssFile = (req, res, next) => {
9+
const newText = req.body.data;
10+
fs.writeFile(path.join(__dirname, '../../app/src/components/main/renderDemo.css'), newText, 'utf-8', (err, data) => {
11+
if (err) throw err;
12+
console.log('CSS Updated!');
13+
next();
14+
});
15+
};
16+
17+
18+
module.exports = userStylesController;

0 commit comments

Comments
 (0)