Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Latest commit

 

History

History

chromium

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

@orbiting/lambdas-chromium

API to puppeteer - chromium.

screenshot.js is a NodeJS request-response-handler to generate screenshots.

puppeteer tries to use locally available chromium (by chrome-aws-lambda) otherwise tries to fall back to connect to PUPPETEER_WS_ENDPOINT

ENVs

see [.env.example]

now -e URL_ALLOWLIST=https://republik.ch,https://www.republik.ch,https://republik.love,https://www.republik.love,https://github.com

Endpoints

  • screenshot.js
    • example query: /?url=:url[&width=:w][&heigth=:h][&zoomFactor=:sf][&fullPage=:fp][&format=:f][&quality=:q][&cookie=:c][&basicAuthUser=:u][&basicAuthPass=:p]
    • renders ?url
    • optional &width &height
      • default 1200x1
    • optional &fullPage
      • default 1
      • this api screenshots the full page per default (with scrolling), set fullPage to 0 to crop to viewport
    • optional &zoomFactor
      • default 1
    • optional &cookie
      • example: 'id=something'
    • optional &basicAuthUser &basicAuthPass
      • send basic auth when requesting ?url
    • optional &format
      • default png
      • supports png, jpeg
    • optional &quality
      • only for jpeg

Credits

Inspired by: now-examples puppeteer-screenshot