UNPKG

traxx

Version:

Asynchronous route-level analytics for Express.js. Tracks latency, request data, and errors. Supports notifications via Teams, Slack, and Google Chat. MongoDB + BullMQ + Redis.

11 lines (9 loc) 268 B
const express = require("express"); const router = express.Router(); module.exports = function (Model) { router.get("/data", async (req, res) => { const data = await Model.find().sort({ timestamp: -1 }).limit(100); res.json(data); }); return router; };