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,
|
|
|
|
getBookmarks,
|
|
|
|
getBookmark,
|
|
|
|
updateBookmark,
|
|
|
|
deleteBookmark
|
|
|
|
} = require('../controllers/bookmark');
|
|
|
|
|
|
|
|
router
|
|
|
|
.route('/')
|
2021-07-28 13:36:03 +03:00
|
|
|
.post(upload, createBookmark)
|
2021-05-23 18:18:04 +03:00
|
|
|
.get(getBookmarks);
|
|
|
|
|
|
|
|
router
|
|
|
|
.route('/:id')
|
|
|
|
.get(getBookmark)
|
2021-07-28 13:36:03 +03:00
|
|
|
.put(upload, updateBookmark)
|
2021-05-23 18:18:04 +03:00
|
|
|
.delete(deleteBookmark);
|
|
|
|
|
|
|
|
module.exports = router;
|