An Express middleware for Rendertron.
Rendertron is a server which runs headless Chrome and renders web pages on the fly, which can be set up to serve pages to search engines, social networks and link rendering bots.
This middleware checks the User-Agent header of incoming requests, and if it matches one of a configurable set of bots, proxies that request through Rendertron.
$ npm install --save express rendertron-middleware
const express = ;const rendertron = ;const app = ;app;app;app;
makeMiddleware function takes a configuration object with the following
||Required||Base URL of your running Rendertron proxy service.|
||A set of known bots that benefit from pre-rendering. Full list.||RegExp for matching requests by User-Agent header.|
||A set of known static file extensions. Full list.||RegExp for excluding requests by the path component of the URL.|
||Force the web components polyfills to be loaded. Read more.|
||Millisecond timeout for the proxy request to Rendertron. If exceeded, the standard response is served (i.e.