Skip to content

qoq-ts/qoq-response-time

Repository files navigation

Response Time

X-Response-Time middleware based on koa-response-time for qoq.

Installation

yarn add qoq-response-time

Usage

import { WebSlotManager } from 'qoq';
import { ResponseTime } from 'qoq-response-time';

export webSlots = WebSlotManager.use(new ResponseTime());

If you need response high resolution in nano time, set hrtime option to true:

new ResponseTime({ hrtime: true });

Sample of response header with hrtime=false (default):

X-Response-Time: 153ms

Sample of response header with hrtime=true:

X-Response-Time: 153.123581ms

About

X-Repsonse-Time middleware for qoq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published