mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-20 08:41:48 +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;
|