Skip to content

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

Notifications You must be signed in to change notification settings

scidock/koa-prerender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-prerender Build Status

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.

Usage

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

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

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

License

ISC

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%