File size: 384 Bytes
001bef4
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;