first commit of refactor
This commit is contained in:
20
backend/api/routes/addresses.js
Normal file
20
backend/api/routes/addresses.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import express from 'express';
|
||||
import { authenticate } from '../../middleware/authenticate.js';
|
||||
import * as AddressController from '../../controllers/AddressController.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// Apply authentication to all routes
|
||||
router.use(authenticate);
|
||||
|
||||
// POST /addresses - Create Blockchain Address
|
||||
router.post('/', AddressController.create);
|
||||
|
||||
// GET /addresses - List Addresses
|
||||
router.get('/', AddressController.list);
|
||||
|
||||
// DELETE /addresses/:addressId - Delete Address
|
||||
router.delete('/:addressId', AddressController.remove);
|
||||
|
||||
export default router;
|
||||
|
||||
12
backend/api/routes/alertEvents.js
Normal file
12
backend/api/routes/alertEvents.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import express from 'express';
|
||||
import { authenticate } from '../../middleware/authenticate.js';
|
||||
import * as AlertEventController from '../../controllers/AlertEventController.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.use(authenticate);
|
||||
|
||||
router.get('/', AlertEventController.list);
|
||||
|
||||
export default router;
|
||||
|
||||
18
backend/api/routes/alerts.js
Normal file
18
backend/api/routes/alerts.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import express from 'express';
|
||||
import { authenticate } from '../../middleware/authenticate.js';
|
||||
import * as AlertRuleController from '../../controllers/AlertRuleController.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.use(authenticate);
|
||||
|
||||
router.post('/:addressId/alerts', AlertRuleController.create);
|
||||
|
||||
router.get('/:addressId/alerts', AlertRuleController.listByAddress);
|
||||
|
||||
router.patch('/:alertId', AlertRuleController.updateStatus);
|
||||
|
||||
router.delete('/:alertId', AlertRuleController.remove);
|
||||
|
||||
export default router;
|
||||
|
||||
16
backend/api/routes/notificationConfig.js
Normal file
16
backend/api/routes/notificationConfig.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import express from 'express';
|
||||
import { authenticate } from '../../middleware/authenticate.js';
|
||||
import * as NotificationConfigController from '../../controllers/NotificationConfigController.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.use(authenticate);
|
||||
|
||||
router.get('/', NotificationConfigController.getConfig);
|
||||
|
||||
router.put('/', NotificationConfigController.updateConfig);
|
||||
|
||||
router.delete('/', NotificationConfigController.deleteConfig);
|
||||
|
||||
export default router;
|
||||
|
||||
17
backend/api/routes/status.js
Normal file
17
backend/api/routes/status.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import express from 'express';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// GET /status - System Status (mock)
|
||||
router.get('/', (req, res) => {
|
||||
// TEMP - Mock response until poller service is complete
|
||||
res.json({
|
||||
latestBlock: 0,
|
||||
lag: 0,
|
||||
status: 'healthy',
|
||||
timestamp: new Date().toISOString()
|
||||
});
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user