JSPM

server-timi

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 78
  • Score
    100M100P100Q76989F
  • License MIT

Server timing API plugin for hapi

Package Exports

  • server-timi

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (server-timi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

server-timi

Current Version Build Status via Travis CI Dependencies belly-button-style

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();