hapi-amp
v2.1.2
Published
Loads AMP views
Downloads
38
Readme
hapi-amp
Accelerated Mobile Pages (AMP) for Hapi.
Install
npm install hapi-amp
Usage
Basic:
// index.js
server.register(require('hapi-amp'));
# 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.