Update v1.0.0-beta.12, addition of external APIs and optimization
This commit is contained in:
16
routes/Dpanel/API/BackgroundCustom.js
Normal file
16
routes/Dpanel/API/BackgroundCustom.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const authMiddleware = require('../../../Middlewares/authMiddleware');
|
||||
|
||||
router.post('/', authMiddleware, (req, res) => {
|
||||
const { backgroundUrl } = req.body;
|
||||
|
||||
if (!backgroundUrl) {
|
||||
return res.status(400).json({ message: 'Background URL missing.' });
|
||||
}
|
||||
|
||||
res.cookie('background', backgroundUrl, { httpOnly: true });
|
||||
res.status(200).json({ message: 'Background updated successfully.' });
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user