import { Router } from 'express';
import bookstackController from '../controllers/bookstack.controller';
import { authenticate } from '../middleware/auth.middleware';
import { requirePermission } from '../middleware/rbac.middleware';

const router = Router();

router.get('/recent', authenticate, requirePermission('wissen:view'), bookstackController.getRecent.bind(bookstackController));
router.get('/search', authenticate, requirePermission('wissen:view'), bookstackController.search.bind(bookstackController));
router.get('/pages/:id', authenticate, requirePermission('wissen:view'), bookstackController.getPage.bind(bookstackController));

export default router;
