mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-21 01:01:30 +03:00
21 lines
451 B
JavaScript
21 lines
451 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
// middleware
|
|
const { auth, requireAuth } = require('../middleware');
|
|
|
|
const {
|
|
getQueries,
|
|
addQuery,
|
|
deleteQuery,
|
|
updateQuery,
|
|
} = require('../controllers/queries/');
|
|
|
|
router.route('/').post(auth, requireAuth, addQuery).get(getQueries);
|
|
router
|
|
.route('/:prefix')
|
|
.delete(auth, requireAuth, deleteQuery)
|
|
.put(auth, requireAuth, updateQuery);
|
|
|
|
module.exports = router;
|