All Projects → RisingStack → koa-prerender

RisingStack / koa-prerender

Licence: other
KOA middleware for prerendering javascript-rendered pages on the fly for SEO

Programming Languages

javascript
184084 projects - #8 most used programming language

koa-prerender Build Status

NPM

KOA middleware for prerendering javascript-rendered pages on the fly for SEO

This koa middleware intercepts requests to your Node.js website from crawlers, and then makes a call to the (external) Prerender service to get the static HTML instead of the javascript for that page.

Setup

Prerequisites

Install Prerender on a server of your choice.

Install

Install the package with npm:

$ npm install koa-prerender

Usage

var prerender = require('koa-prerender');

// Options
var options = {
  prerender: PRERENDER_SERVER_URL   // optional, default:'http://service.prerender.io/'
  protocol: 'http',                 // optional, default: this.protocol
  host: 'www.risingstack.com'       // optional, default: this.host,
  prerenderToken: ''                // optional or process.env.PRERENDER_TOKEN
};

// Use as middleware
app.use(prerender(options));

License

ISC

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].