1.1.1 • Published 4 years ago

@dukai.net/hapi-time v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

hapi-time.js

Hapi response time management component

Install:

npm install @dukai.net/hapi-time

or:

yarn add @dukai.net/hapi-time

Use:

path: '/api/v1/orange/{id}',
method: 'GET',
handler: async (request, h) => {
    try {
        h.timerStart(request, 'mycalltimer');
        const out = await dal.orange.getSomething(args);
        h.timerEnd(request, 'mycalltimer');
    } catch (err) {
        return boom.boomify(err, { statusCode: 400 });
    }
},

The measured and named times will be injected into the response header with x-time-(name) format.

The full time of the request will be under the name: x-time-request.

1.1.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago