Add watcher routes to backend and frontend; implement routing and UI components for watcher management
This commit is contained in:
20
backend/src/routes/watcher.js
Normal file
20
backend/src/routes/watcher.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const WatcherController = require('../controllers/WatcherController');
|
||||
const unhashRequestIds = require('../middleware/unhashRequest');
|
||||
|
||||
/**
|
||||
* Routen für Watcher (Berechtigungen)
|
||||
*/
|
||||
|
||||
// GET /api/watcher - Alle Watcher abrufen
|
||||
router.get('/', WatcherController.getWatchers.bind(WatcherController));
|
||||
|
||||
// POST /api/watcher - Neuen Watcher hinzufügen
|
||||
router.post('/', WatcherController.addWatcher.bind(WatcherController));
|
||||
|
||||
// DELETE /api/watcher/:id - Watcher entfernen
|
||||
router.delete('/:id', unhashRequestIds, WatcherController.removeWatcher.bind(WatcherController));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user