https://github.com/wayou/ssr-demo
ssr demo using puppeteer
https://github.com/wayou/ssr-demo
puppeteer ssr
Last synced: 25 days ago
JSON representation
ssr demo using puppeteer
- Host: GitHub
- URL: https://github.com/wayou/ssr-demo
- Owner: wayou
- Created: 2018-05-19T09:01:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-19T09:17:25.000Z (almost 7 years ago)
- Last Synced: 2025-03-24T17:51:55.222Z (about 1 month ago)
- Topics: puppeteer, ssr
- Language: JavaScript
- Size: 7.81 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Server side render using headless chrome
===### run locally
- install
```bash
$ npm i
```- start the server
```bash
$ node server.js
```- visit `localhost:8080/`
### notes
In `server.js`, make the `public/index.html` accessible.
```js
app.use(express.static("./"));
```process `localhost:8080/` to return `public/index.htmtl` throught puppeteer.
see the time cost by ssr in Chrome Devtools.
### reference
- [Headless Chrome: an answer to server-side rendering JS sites](https://developers.google.com/web/tools/puppeteer/articles/ssr)