Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smallstack/smallstack-webpage-renderer
Tiny server that renders a webpage and returns it as PNG
https://github.com/smallstack/smallstack-webpage-renderer
Last synced: 9 days ago
JSON representation
Tiny server that renders a webpage and returns it as PNG
- Host: GitHub
- URL: https://github.com/smallstack/smallstack-webpage-renderer
- Owner: smallstack
- License: mit
- Created: 2016-09-18T11:46:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-26T14:02:56.000Z (over 8 years ago)
- Last Synced: 2024-11-11T08:47:18.192Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smallstack-webpage-renderer
This is a tiny server that renders a given url and returns it as PNG image. At smallstack.io we use it to render previews of javascript enabled pages.**Note:** The server will wait for window.prerenderReady=true to be set unless you set waitforprerender=false!
## How-to run
### via node
```npm install && npm run serve```### via docker
``` docker run -p 80:80 -d smallstack/smallstack-webpage-renderer```## How-to use
The tiny server has only one endpoint so far, which is ```/render```. Possible Parameters are :Parameter | Optional | Default Value | Example | Description
------------ | ------ | ------------- | ------- | -------------
url | no | - | https://smallstack.io | The url to be rendered
mobile | yes | false | true | Sets useragent to iPhone and uses smaller screen size
width | yes | 1280 (mobile: 375) | 3840 | The browser width
height | yes | 800 (mobile: 677) | 2160 | The browser height
additionalWait| yes | 100 | 5000 | additional ms to wait after page got loaded
waitforprerender| yes | true | true | The prerenderReady flag is used by prerender.io and already baked into all of our apps. If you don't use that service or if you don't have that flag set, please set this parameter to false!### Example
http://localhost/render?url=https://smallstack.io&width=600&height=800&mobile=true&additionalWait=2000