request-received
Route middleware for Koa and Express that adds a request received high-resolution timer and Date to the request object using easily accessible Symbols to prevent request object pollution. Made for Cabin.
Table of Contents
Install
npm:
npm install request-received
yarn:
yarn add request-received
Usage
Express
Symbols are automatically added to
req
object in route middleware:
const express = ;const Cabin = ;const requestReceived = ;const responseTime = ;const requestId = ; const startAt = Symbol;const startTime = Symbol; const app = ;const Cabin = ; app; app; app;app;app; app;
Koa
Symbols are automatically added to
ctx
,ctx.req
, andctx.request
objects in route middleware:
const Koa = ;const koaConnect = ;const responseReceived = ;const responseTime = ;const requestId = ; const startAt = Symbol;const startTime = Symbol; const app = ;const Cabin = ; app; app; app;app;app; app;
Contributors
Name | Website |
---|---|
Nick Baugh | http://niftylettuce.com/ |