User-agent information plugin for hapi
JavaScript
Latest commit 3e18271 Jul 19, 2016 @danielb2 danielb2 committed on GitHub Merge pull request #33 from gergoerdosi/node-v6
Test on node v6, update dependencies

README.md

scooter Logo

Scooter is a User-agent information plugin for hapi

Build Status

Lead Maintainer: Daniel Bretoi

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

Usage

    const Hapi = require('hapi');
    const server = new Hapi.Server(8086);
    const Scooter = require('scooter');

    server.route({
        method: 'GET',
        path: '/user-agent',
        handler: (request, reply) => {

            return reply(request.plugins.scooter.toJSON());
        }
    });

    server.register(Scooter, (err) => {

        server.start(() => {

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