Socket
Book a DemoInstallSign in
Socket

bot-koa-prerender

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bot-koa-prerender

send bot requests through prerender.io for koajs

5.1.0
latest
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

bot-koa-prerender

NPM

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

This koa middleware intercepts requests to your Node.js website from bots, 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 bot-koa-prerender`

Usage

var prerender = require('bot-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,
  prerender_token: ''               // optional or process.env.PRERENDER_TOKEN
};

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

Heavily inspired by

Gergely Nemeth mail@nemethgergely.com (http://twitter.com/nthgergo)

License

MIT

FAQs

Package last updated on 21 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.