-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebhook.js
More file actions
25 lines (20 loc) · 916 Bytes
/
webhook.js
File metadata and controls
25 lines (20 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* Webhook Routes
* Routes for webhook registration and handling
*/
const express = require('express');
const router = express.Router();
const webhookController = require('../controllers/webhookController');
const { authenticate } = require('../middleware/auth');
// Xero webhook endpoint (no authentication required)
router.post('/xero', webhookController.handleXeroWebhook);
// Apply authentication middleware to all other routes
router.use(authenticate);
// Webhook management endpoints
router.post('/register', webhookController.registerWebhook);
router.get('/list', webhookController.listWebhooks);
router.put('/:webhookId', webhookController.updateWebhook);
router.delete('/:webhookId', webhookController.deleteWebhook);
router.post('/:webhookId/regenerate-secret', webhookController.regenerateWebhookSecret);
router.post('/:webhookId/test', webhookController.testWebhook);
module.exports = router;