server-timi
v1.0.0
Published
Server timing API plugin for hapi
Downloads
357
Readme
server-timi
Server timing API plugin for hapi.
Example
server-timi
does not accept any options. To use it, register the plugin with a hapi server, and the Server-Timing
header will be automatically added to the server's responses.
'use strict';
const Hapi = require('@hapi/hapi');
const ServerTimi = require('server-timi');
async function main () {
const server = Hapi.server({ port: 8080 });
await server.register({ plugin: ServerTimi });
server.route({
method: 'GET',
path: '/foo',
handler (request, h) {
return { foo: 'bar' };
}
});
await server.start();
}
main();