mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-18 23:41:39 +03:00
30 lines
665 B
JavaScript
30 lines
665 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
// middleware
|
|
const { upload, auth, requireAuth } = require('../middleware');
|
|
|
|
const {
|
|
createBookmark,
|
|
getAllBookmarks,
|
|
getSingleBookmark,
|
|
updateBookmark,
|
|
deleteBookmark,
|
|
reorderBookmarks,
|
|
} = require('../controllers/bookmarks');
|
|
|
|
router
|
|
.route('/')
|
|
.post(auth, requireAuth, upload, createBookmark)
|
|
.get(auth, getAllBookmarks);
|
|
|
|
router
|
|
.route('/:id')
|
|
.get(auth, getSingleBookmark)
|
|
.put(auth, requireAuth, upload, updateBookmark)
|
|
.delete(auth, requireAuth, deleteBookmark);
|
|
|
|
router.route('/0/reorder').put(auth, requireAuth, reorderBookmarks);
|
|
|
|
module.exports = router;
|