mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 11:39:36 +02:00
Added auth middleware. Added access control to apps
This commit is contained in:
parent
d1c61bb393
commit
e3f167921c
16 changed files with 92 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const upload = require('../middleware/multer');
|
||||
const auth = require('../middleware/auth');
|
||||
|
||||
const {
|
||||
createApp,
|
||||
|
@ -11,10 +12,14 @@ const {
|
|||
reorderApps,
|
||||
} = require('../controllers/apps');
|
||||
|
||||
router.route('/').post(upload, createApp).get(getAllApps);
|
||||
router.route('/').post(auth, upload, createApp).get(auth, getAllApps);
|
||||
|
||||
router.route('/:id').get(getSingleApp).put(upload, updateApp).delete(deleteApp);
|
||||
router
|
||||
.route('/:id')
|
||||
.get(auth, getSingleApp)
|
||||
.put(auth, upload, updateApp)
|
||||
.delete(auth, deleteApp);
|
||||
|
||||
router.route('/0/reorder').put(reorderApps);
|
||||
router.route('/0/reorder').put(auth, reorderApps);
|
||||
|
||||
module.exports = router;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue