Git Product home page Git Product logo

indexable-pwa-samples's Introduction

Indexable PWA

A sample ExpressJS PWA that explores and demonstrates the best practices for implementing a PWA in regards to indexability of content.

Can be configured for 3 specific rendering modes:

  • Client
  • Server
  • Hybrid

Local Development Setup

Install this package via npm:

npm install

Install bower and the fetch polyfill to support Safari:

npm install bower
bower install fetch

Run the server via:

node server.js

Deploying to App Engine

Follow this link to setup your App Engine project for Node.JS:

https://cloud.google.com/nodejs/

To deploy a particular configuration to App Engine specify the yaml file:

gcloud app deploy app.yaml

Use app.yaml to set environment variables to override the config.js file.

Example .yaml file:

runtime: nodejs
vm: true
env_variables:
  AMP_MODE: disabled
  RENDER_MODE: hybrid
  UPDATE_MODE: json

Configuration Patterns

Configure config.js:

  • ampMode: [enabled, disabled]
  • renderMode: [server, client, hybrid]
  • updateMode: [json, html, disabled]
    • json: causes AJAX requests to be fetched as JSON from the server and the DOM to be updated via reading the JSON.
    • html: causes AJAX requests to be fetched as HTML from the server, the HTML is parsed on the client and the DOM to be updated via reading the parsed HTML from the server.

Recommended configuration patterns:

Server Sample

For server-side rendering:

{
  "ampMode": "disabled",
  "renderMode": "server",
  "updateMode": "disabled",
  "googleSiteVerificationToken": ""
}

Client Sample

For client-side rendering.

updateMode can be configured as either 'json' or 'html'.

{
  "ampMode": "disabled",
  "renderMode": "client",
  "updateMode": "json",
  "googleSiteVerificationToken": ""
}

Hybrid Sample

For hybrid rendering.

updateMode can be configured as either 'json' or 'html'.

{
  "ampMode": "disabled",
  "renderMode": "hybrid",
  "updateMode": "json",
  "googleSiteVerificationToken": ""
}

indexable-pwa-samples's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

indexable-pwa-samples's Issues

React Project

Hi,

Our React project not indexable without prerender.
Whats special in this sample? ("https://", "appspot domain" or "is react a problem?")

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.