/puppeteer-screenshot

Get screenshot for some site and serve as an image

Primary LanguageJavaScript

puppeteer-screenshot

Goal

The goal is generate a screenshot of some web site to be embed some place else.

Routes

Screenshot

GET /

Get the current saved screenshot

Print

GET /print

Take a screenshot and save it

Configuration

Configuration by environment variables:

Variable Meaning Default
PORT Outgoing application port 3000
URL Webpage to screenshot https://www.github.com/ebdonato
AUTO_HOURS1 Hours of day to renew the screenshot 9 21
TIMEOUT2 Navigation timeout (in seconds) 300
EXECUTABLE_PATH Path to Chrome, leave blank to use Puppetter embedded one

Docker

Criando a imagem Docker

docker build . --build-arg URL="https://www.github.com/ebdonato" -t ebdonato/puppeteer-screenshoot:tag

Criando um container com a image

docker run -d -p 3000:3000 -e URL="https://dev.page/ebdonato" ebdonato/puppeteer-screenshoot:tag

Footnotes

  1. Only natural integer number equal or greater then 0 and lower than 24

  2. This value is used to Puppeteer page default timeout