A server-side rendering pushstate server, just cd into a directory with your index.html and js files and run prerendercloud-server
JavaScript Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.babelrc
.gitignore
.npmignore
Makefile
README.md
package.json
yarn.lock

README.md

image

prerendercloud-server

A pushstate server that includes the official prerender.cloud middleware for server-side rendering your single-page JavaScript applicaiton (React, Angular, Ember, Preact, Vue, etc.)

This is mostly used for testing an app against service.prerender.cloud before going into production.

Requirements

  • index.html at the root of the deployed project
  • pushstate URLs
  • React, Preact, Angular, Ember, Vue, or any SPA framework that rewrites a container DOM element (Angular users must use templates)

read more here: https://www.prerender.cloud/docs

Usage

npm install -g prerendercloud-server

now navigate to your project directory

usage: prerendercloud-server [options] [directory]

Environment variables

Options

  • --help
  • --debug
  • --enable-middleware-cache
    • a local, in-memory cache to avoid hitting service.prerender.cloud on every request

Examples

# start the server in the current directory
prerendercloud-server
# start the server for the dist directory
prerendercloud-server dist
# start the server for the dist directory and run it on PORT 9000
PORT=9000 prerendercloud-server dist
# start the server for the dist directory and run it on PORT 9000 and use the local cache
# (the cache won't expire until you terminate this node instance)
PORT=9000 prerendercloud-server dist --enable-middleware-cache
# start the server in the current directory with your API token
# from https://www.prerender.cloud to avoid rate limits
PRERENDER_TOKEN=my-secret-token prerendercloud-server

The _redirects file

Like Roast.io and Netlify, this server supports a _redirects file - read more about it here: https://www.roast.io/docs/config/redirects