el-borracho-stats
Version:
REST and SSE API and worker producing daily and all-time totals for Bull queues
22 lines (15 loc) • 735 B
text/coffeescript
SSEriesOfTubes = require "sseries-of-tubes"
Stats = require "../el-borracho-stats"
class ElBorrachoStatsRouter
constructor: ({server, redis, namespace, }) ->
= new SSEriesOfTubes server
= new Stats {redis, namespace}
or= new (require "express").Router
bindRoutes: ->
.get "/sse/all", .combine "/sse/history", "/sse"
.get "/sse/history", .plumb .history, 30, "history"
.get "/sse", .plumb .total, 2, "total"
.get "/history", .history
.get "/", .total
module.exports = ElBorrachoStatsRouter