Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 768 Bytes

File metadata and controls

33 lines (20 loc) · 768 Bytes

paperlesspaper node-samples

Minimal Node.js example for uploading (swapping) the image shown on an ePaper screen using the paperlesspaper API. This code is used in the tutorial in the paperlesspaper Blog.

  • POST /papers/uploadSingleImage/:paperId

Setup

  • Node.js >= 18

Install deps:

npm install

Run

Set env vars (API key) and call the script with paperId and a local image path:

export PAPERLESSPAPER_API_KEY="..."

node upload-image.mjs <PAPER_ID> /path/to/image.png

Optional base URL override:

export PAPERLESSPAPER_API_BASE="https://api.memo.wirewire.de/v1"

The script prints the returned paper object JSON. Watch imageUpdatedAt to confirm the update.