mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-21 09:11:29 +03:00
30 lines
600 B
JavaScript
30 lines
600 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
// middleware
|
|
const { auth, requireAuth, upload } = require('../middleware');
|
|
|
|
const {
|
|
createApp,
|
|
getAllApps,
|
|
getSingleApp,
|
|
updateApp,
|
|
deleteApp,
|
|
reorderApps,
|
|
} = require('../controllers/apps');
|
|
|
|
router
|
|
.route('/')
|
|
.post(auth, requireAuth, upload, createApp)
|
|
.get(auth, getAllApps);
|
|
|
|
router
|
|
.route('/:id')
|
|
.get(auth, getSingleApp)
|
|
.put(auth, requireAuth, upload, updateApp)
|
|
.delete(auth, requireAuth, deleteApp);
|
|
|
|
router.route('/0/reorder').put(auth, requireAuth, reorderApps);
|
|
|
|
module.exports = router;
|