2.0.0 • Published 6 years ago

puppeteer-screenshot-server v2.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

puppeteer-screenshot-server

Used to generate screen shots of a presentation. The server receives a URL containing a presentation ID and returns JSON with the informatin about the exports.

Proposed end points

# install
git clone git@github.com:slidebean/puppeteer-screenshot-server.git
cd puppeteer-screenshot-server
npm install
npm run compile

# run server
node start
 or
nodemon index.js
 or
DEBUG=PUPSHOT,PUPSHOT_SRV nodemon index.js

### presentation routes

# returns OK when working
HOST/checkme

# get system info
HOST/sysinfo


### presentation routes
# take screen shots
HOST/:presentationID/screenshot

# get slide image
HOST/:presentationID/slide/:slidenum
or
HOST/:presentationID/slidefile/:slidefile

# delete presentation directory
HOST/:presentationID/delete

House keeping

Durning development and testing, we tested on a server with low resources (1 GB of RAM) aws linux machine. When many procosses where run at the same time, the loading more than one chromium instance could cause the loss connection from puppeteer to the browser. The browser processes could be then be orphaned and waste server resources in those processed. We suggest scheduling a cleanup script (cleanup-orphaned-chromium-processes) to be run every few minutes, perhaps a cron job. Below are some support scripts, please see the comments in the header.

Scprits:

scripts/
  cleanup-orphaned-chromium-processes
  find-errors-screenshot-server
  monitor-client-server
  monitor-screenshot-server