2.1.2 • Published 9 months ago

tn-route-traffics v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Middleware

app.use(
  routeTrafficsMiddleware({
    concurrency: 6,
    maxQueue: 10000,
    unlockTimeout: '1m',
    forceCloseTimeout: '10m',
    excludes: ['/status'],
    bypass: ['/bypass'],
    bypassSecret: '**********',
    logDump: dump => {...},
    logDumpInterval: '1m',
    logDumpExtras: {
      base: () => ({}),
      pressure: () => ({}),
      visit: req => ({ user: req.user || null })
    },
  })
)

Status

$routeTraffic.status.getStatus()

How Bypass Header Work

  • Set bypassSecret in opts
  • Create bypass headers using routeTrafficsBypassHeaders()
  • It will generate a header object like { trafficbypass: "***" }
  • Requests with these headers will be bypass the queue
2.1.2

9 months ago

2.1.1

9 months ago

2.1.0

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.4.0

9 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago