Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juffalow/node-react-seo-example
An example of server side rendering ( for SEO purposes )
https://github.com/juffalow/node-react-seo-example
nodejs puppeteer react seo server-side-rendering
Last synced: 10 days ago
JSON representation
An example of server side rendering ( for SEO purposes )
- Host: GitHub
- URL: https://github.com/juffalow/node-react-seo-example
- Owner: juffalow
- Created: 2019-01-24T12:56:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-25T14:02:57.000Z (almost 6 years ago)
- Last Synced: 2024-10-06T06:04:02.314Z (3 months ago)
- Topics: nodejs, puppeteer, react, seo, server-side-rendering
- Language: JavaScript
- Size: 200 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node React SEO Example
Example how to setup server side rendering.
## Installation
```bash
$ yarn install# or if you use npm
$ npm i
```## How it works
You can run the project like a regular React project with `yarn start`
and if you want to try server side rendering `yarn run server`.This will create a server listening on `localhost:8088`.
### Routes
Root page `http://localhost:8088/` renders Home page with initial title and description.
If you go to StarWars -> Luke Skywalker ( `http://localhost:8088/star-wars/1` )
and refresh the page, node server will use `puppeteer` to get the data, render the page
and return it. And if you go to StarWars -> Darth Wader and reload the page,
node server will also return the page pre-rendered, but this time the server hase to
download all data needed to render it, inject them into the page, render it
with `React.renderToString` and then return.