mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 11:39:36 +02:00
Backend: auth for config and queries. Refactor of middleware exports
This commit is contained in:
parent
e3f167921c
commit
22471d64c7
10 changed files with 43 additions and 31 deletions
|
@ -1,6 +1,9 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
// middleware
|
||||
const { auth, requireAuth } = require('../middleware');
|
||||
|
||||
const {
|
||||
getCSS,
|
||||
updateCSS,
|
||||
|
@ -8,8 +11,8 @@ const {
|
|||
updateConfig,
|
||||
} = require('../controllers/config');
|
||||
|
||||
router.route('/').get(getConfig).put(updateConfig);
|
||||
router.route('/').get(getConfig).put(auth, requireAuth, updateConfig);
|
||||
|
||||
router.route('/0/css').get(getCSS).put(updateCSS);
|
||||
router.route('/0/css').get(getCSS).put(auth, requireAuth, updateCSS);
|
||||
|
||||
module.exports = router;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue