Download src/routes/admin.js from TwanAPI/trsstapi: direct link, hf CLI and curl.
- Browser
- Download file 384 Bytes
-
https://huggingface.co/spaces/TwanAPI/trsstapi/resolve/main/src/routes/admin.js
- Command line
-
hf download hf://spaces/TwanAPI/trsstapi/src/routes/admin.js
-
curl -L -o admin.js https://huggingface.co/spaces/TwanAPI/trsstapi/resolve/main/src/routes/admin.js
384 Bytes
| 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; | |