hapi-amp

2.1.2 • Public • Published

hapi-amp

Build Status Coverage Status

Accelerated Mobile Pages (AMP) for Hapi.

Install

npm install hapi-amp

Usage

Basic:

// index.js
server.register(require('hapi-amp'));

Rapptor:

# default.yaml
plugins:
  hapi-amp:

Serving AMP pages

In order to service up an amp view you will need to create a file that matches a view but end with -amp in the name.

Example:

reply('pages/homepage');

You'd name the mobile version pages/homepage-amp.html

We also expose a global view context __isAMP.

Viewing

Direct the user to the same url but with a ?amp=1 query string.

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i hapi-amp

    Weekly Downloads

    7

    Version

    2.1.2

    License

    MIT

    Unpacked Size

    4.99 kB

    Total Files

    5

    Last publish

    Collaborators

    • jga
    • dawnerd
    • ecwillis
    • orthagonal1
    • alaguna
    • aleperez92