Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 668 Bytes

API.md

File metadata and controls

30 lines (21 loc) · 668 Bytes

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

Usage

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