Skip to content

@hapi/scooter v7.0.0

console
npm install @hapi/scooter@7.0.0
console
yarn add @hapi/scooter@7.0.0
console
pnpm add @hapi/scooter@7.0.0

User-agent information plugin.

Compatibility

Major versionLicenseNode.js
8BSD>= 16
7BSD>= 16

Scooter uses the [useragent] package to provide user-agent information. For more details of what information scooter provides, please see the useragent.

Usage

javascript
const Hapi = require('@hapi/hapi');
const Scooter = require('@hapi/scooter');

const start = async () => {
  const server = new Hapi.Server();

  server.route({
    method: 'GET',
    path: '/user-agent',
    handler: (request, h) => {
      return request.plugins.scooter;
    },
  });

  await server.register(Scooter);
  await server.start();
  console.log(server.info.uri + '/user-agent');
};

start();

Deploys by Netlify