• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ExpressJs middleware for rendering PWA to bots using Puppeteer.

pupperender

npm Build Status Build status codecov

ExpressJs middleware for rendering PWA to bots using Puppeteer

This is a middleware for ExpressJs that uses Puppeter for render the page requested by "indexing" bots (and not).

This is a fork of the rendertron-middleware but using Puppeter instead of Rendertron, without needing another server to render the app. I have made some changes for my personal use (like removing the inject ShadyDOM option).

Install

$ yarn add pupperender

Usage

const express = require('express');
const pupperender = require('pupperender');

const app = express();

app.use(pupperender.makeMiddleware({}));

app.use(express.static('files'));
app.listen(8080);

Configuration

Like rendertron-middleware I decided to expose a makeMiddleware function that takes a configuration object with the following properties:

Property Default Description
userAgentPattern A set of known bots that benefit from pre-rendering. Full list. RegExp for matching requests by User-Agent header.
excludeUrlPattern A set of known static file extensions. Full list. RegExp for excluding requests by the path component of the URL.
timeout 11000 Millisecond timeout for waiting the page to load. Used by Puppeter. See also the Puppeter waitFor()
debug false DEBUG flag to show some logs
useCache false If the puppeterized content should be cached to speed up subsequent requests.
cacheTTL 3600 Seconds until cached content is disregarded and puppeterized again. Only considered when useCache is true.

License

MIT Β© LasaleFamine

More Repositories

1

docker-mongo-parse-server

docker-compose ready for MongoDB, parse-server and parse-dashboard.
JavaScript
32
star
2

http-server-pwa

πŸ‘Ύ http-server alike but for serving and rendering PWA: pwa-server
JavaScript
15
star
3

phi-zsh-theme

Clean and simple theme for ZSH.
Shell
13
star
4

polymer-3

Welcome Polymer 3 (and ES Modules and NPM [and Webpack and PostCSS])
JavaScript
11
star
5

stylelint-design-tokens-plugin

Stylelint plugin for checking Design Tokens use inside your CSS.
JavaScript
11
star
6

polymer-3-lit

Polymer 3 with lit-html implementation for rendering.
JavaScript
7
star
7

eslintc

Opinionated ESLint sharable configuration for my projects.
JavaScript
6
star
8

create-app

Opinionated app generator.
TypeScript
4
star
9

ragusabot

πŸ“° Telegram and Facebook bot for getting the latest news of Ragusa.
JavaScript
2
star
10

ts-module-boilerplate

Node.js Typescript module boilerplate
Shell
2
star
11

machine-setup

πŸ’Ύ Useful BASH scripts for installation of needed softwares and configurations for new Virtual Machines.
Shell
2
star
12

string-normalize-es6

Normalize to NFD a string using ES6 String.Prototype.Normalize
JavaScript
2
star
13

polymer-hyper

Sample component with Polymer 3 and hyperHTML
JavaScript
2
star
14

vscode-css-vars

VSCode extension for CSS var and env var autocomplete
TypeScript
2
star
15

runnable-exports

Run your exports as command line arguments
JavaScript
2
star
16

medium-webpack-workbox

Sample repository for the Medium article
HTML
2
star
17

instagram-scraper-node

Wrapper of the Python instagram-scraper using nopy.
JavaScript
2
star
18

ace-editor

Polymer (ES6) wrapper of Ace (C9) editor
JavaScript
2
star
19

s3-upload-api

JavaScript
1
star
20

channel-telegram-bot

Bot for Telegram to simply send actions to a channel (Telebot wrapper)
JavaScript
1
star
21

readdir-life

πŸ“ Check the oldest/latest files/folders within a directory
JavaScript
1
star
22

docker-frontend-testing

🐳 FROM ubuntu. With Node, Yarn, Xvfb, Chrome and Firefox installed.
Dockerfile
1
star
23

ng-pagespeed-cs50x

AngularJs application (front-end of express-pagespeed) for CS50x2016 Final Project
JavaScript
1
star
24

express-pagespeedapi

Simple NodeJs-Express application integrated with PageSpeed API
JavaScript
1
star
25

polymer-twitter-timeline

Polymer (ES6) wrapper of Twitter Widget Library for Timelines
JavaScript
1
star
26

breeders

TypeScript
1
star
27

godev.space

Personal website.
CSS
1
star
28

key-as-array

JavaScript
1
star
29

phunctional

"Almost functional" useful methods which I like to use in my projects.
JavaScript
1
star
30

generator-phinm

➰ Scaffold out a node module.
JavaScript
1
star
31

tsconfig

Sharable tsconfig.json
1
star
32

gha-command

GitHub Action run a command and save the output
JavaScript
1
star
33

LoRa-docs

1
star
34

lasalefamine

1
star
35

git-user-local

Get Git user info from local git config
JavaScript
1
star
36

pwa-check-good-party

Polymer 2 web app to check the Milano Js Good Party 2017 talks likes
HTML
1
star
37

check-good-party

Check the milano-js/good-party-2017 likes
JavaScript
1
star
38

g-related-search-ext

Get Google SERP related search from your current search.
JavaScript
1
star
39

basic-php-website-template

Very basic HTML to PHP template for speed-up development.
PHP
1
star