flame/routes/bookmark.js

22 lines
466 B
JavaScript
Raw Normal View History

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