hapi-mobile-detect

1.3.5 • Public • Published

hapi-mobile-detect is a User-agent information plugin for hapi

hapi-mobile-detect is a fork of Scooter authored and maintained by Daniel Bretoi.

hapi-mobile-detect uses the [mobile-detect] package to provide user-agent information. For more details of what information hapi-mobile-detect provides, please see the mobile-detect web-page.

Usage

    const Hapi = require('hapi');
    const server = new Hapi.Server(8086);
    const MobileDetect = require('hapi-mobile-detect');
 
    server.route({
        method: 'GET',
        path: '/is-mobile',
        handler: (request, reply) => {
 
            return reply(request.plugins.md.mobile());
        }
    });
 
    server.register(MobileDetect, (err) => {
 
        server.start(() => {
 
            console.log(server.info.uri + '/is-mobile');
        });
    });

/hapi-mobile-detect/

    Package Sidebar

    Install

    npm i hapi-mobile-detect

    Weekly Downloads

    1

    Version

    1.3.5

    License

    BSD-3-Clause

    Last publish

    Collaborators

    • machellerogden