| import express from "express"; | |
| import { auth } from "../middleware/auth.js"; | |
| import { adminIp } from "../middleware/adminIp.js"; | |
| import { AuditLog } from "../models/AuditLog.js"; | |
| const r = express.Router(); | |
| r.get("/security/anomalies", auth, adminIp, async (req, res) => { | |
| const logs = await AuditLog.find({ isAnomaly: true }).limit(100); | |
| res.json(logs); | |
| }); | |
| export default r; | |