0.2.0 • Published 8 years ago
ssrer v0.2.0
ssrer
Overview
ssrer is an abbreviation for Server-Side Renderer. ssrer sends a request with a headless browser called Puppeteer. Since it uses headless browser the requests from it can be treated just the same as requests from real users.
ssrer shows more power with ssrer-express-middleware in Node.js and Express environment.
How to Use
$ git clone git@github.com:cam-inc/ssrer.git
$ npm install .
$ PORT=3000 npm run starthttp://localhost:3000/?url=https://google.com/ to get string fo HTML context.
Queries
| name | required | default | description |
|---|---|---|---|
| url | yes | - | URI-encoded url of a website to scrape. |
| width | no | 1024 | width of viewport. |
| height | no | 768 | height of viewport. |
| timeout | no | 10000 | time in milliseconds to timeout. |
| waitUntil | no | networkidle | networkidle or load can be passed. with networkidle, the page will be considered loaded when the network activity stays idle for a while. with load, the page will be considered loaded when HTML's load event is fired. |
| cache | no | true | if false then ssrer doesn't use cache store. |
| disableRequests | no | false | if true then all requests other than type of Document will be aborted. |
with Dockerfile
as an example.
$ docker build -t ssrer ./
$ docker run -it -p 3000:3000 ssrer
$ curl http://localhost:3000/\?url=https://google.com/How to Develop
$ docker run -it -p 3000:3000 -v /host/path/to/ssrer/:/docker/ssrer/ ssrer npm run watch0.2.0
8 years ago