1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-19 03:29:37 +02:00

Changed config api. Split config controllers into separate files. Split bookmarks controllers into separate files

This commit is contained in:
Paweł Malak 2021-10-22 14:00:38 +02:00
parent 76e50624e7
commit cfb471e578
23 changed files with 579 additions and 602 deletions

View file

@ -4,21 +4,18 @@ const upload = require('../middleware/multer');
const {
createBookmark,
getBookmarks,
getBookmark,
getAllBookmarks,
getSingleBookmark,
updateBookmark,
deleteBookmark
} = require('../controllers/bookmark');
deleteBookmark,
} = require('../controllers/bookmarks');
router
.route('/')
.post(upload, createBookmark)
.get(getBookmarks);
router.route('/').post(upload, createBookmark).get(getAllBookmarks);
router
.route('/:id')
.get(getBookmark)
.get(getSingleBookmark)
.put(upload, updateBookmark)
.delete(deleteBookmark);
module.exports = router;
module.exports = router;

View file

@ -2,20 +2,14 @@ const express = require('express');
const router = express.Router();
const {
createPair,
getAllPairs,
getSinglePair,
updateValue,
updateValues,
deletePair,
updateCss,
getCss,
getCSS,
updateCSS,
getConfig,
updateConfig,
} = require('../controllers/config');
router.route('/').post(createPair).get(getAllPairs).put(updateValues);
router.route('/').get(getConfig).put(updateConfig);
router.route('/:key').get(getSinglePair).put(updateValue).delete(deletePair);
router.route('/0/css').get(getCss).put(updateCss);
router.route('/0/css').get(getCSS).put(updateCSS);
module.exports = router;