2021-05-23 18:18:04 +03:00
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
2021-07-28 13:36:03 +03:00
|
|
|
const upload = require('../middleware/multer');
|
2021-05-23 18:18:04 +03:00
|
|
|
|
|
|
|
const {
|
|
|
|
createBookmark,
|
2021-10-22 15:00:38 +03:00
|
|
|
getAllBookmarks,
|
|
|
|
getSingleBookmark,
|
2021-05-23 18:18:04 +03:00
|
|
|
updateBookmark,
|
2021-10-22 15:00:38 +03:00
|
|
|
deleteBookmark,
|
|
|
|
} = require('../controllers/bookmarks');
|
2021-05-23 18:18:04 +03:00
|
|
|
|
2021-10-22 15:00:38 +03:00
|
|
|
router.route('/').post(upload, createBookmark).get(getAllBookmarks);
|
2021-05-23 18:18:04 +03:00
|
|
|
|
|
|
|
router
|
|
|
|
.route('/:id')
|
2021-10-22 15:00:38 +03:00
|
|
|
.get(getSingleBookmark)
|
2021-07-28 13:36:03 +03:00
|
|
|
.put(upload, updateBookmark)
|
2021-05-23 18:18:04 +03:00
|
|
|
.delete(deleteBookmark);
|
|
|
|
|
2021-10-22 15:00:38 +03:00
|
|
|
module.exports = router;
|