mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-21 09:11:29 +03:00
27 lines
575 B
JavaScript
27 lines
575 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
// middleware
|
|
const { upload, auth, requireAuth } = require('../middleware');
|
|
|
|
const {
|
|
createBookmark,
|
|
getAllBookmarks,
|
|
getSingleBookmark,
|
|
updateBookmark,
|
|
deleteBookmark,
|
|
} = 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);
|
|
|
|
module.exports = router;
|