0.2.0 • Published 6 years ago

ssrer v0.2.0

Weekly downloads
5
License
-
Repository
-
Last release
6 years ago

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 start

http://localhost:3000/?url=https://google.com/ to get string fo HTML context.

Queries

namerequireddefaultdescription
urlyes-URI-encoded url of a website to scrape.
widthno1024width of viewport.
heightno768height of viewport.
timeoutno10000time in milliseconds to timeout.
waitUntilnonetworkidlenetworkidle 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.
cachenotrueif false then ssrer doesn't use cache store.
disableRequestsnofalseif 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 watch