Renders to png any chunk of html using headless chrome.
node
npm
google-chrome-stable
Build image
docker build --tag gumgum/html2image .
Run server from container
docker run -p LOCAL_PORT:3000 gumgum/html2image
Run server from container with debug messages
docker run -p LOCAL_PORT:3000 -e "DEBUG=1" gumgum/html2image
Starts express server at port 3000
npm install && npm start
Now browse to http://localhost:3000/ for a half-baked UI (assuming LOCAL_PORT = 3000)
DEBUG
boolean to show extra logsWEBPORT
server portCHROMEPORT
chrome debugging port
GET /
-> renders the UI from (src/views/index.html)POST /image
-> receives a form-data with structure and returns image/png binarytimeout: int width: int height: int html: string
./cli --help
Run server from container
docker run -v gumgum/html2image node cli.js --help
Run server from container with debug messages
docker run -v -e "DEBUG=1" gumgum/html2image node cli.js --help
- When cli is running in container I haven't figured out how to write to volume
- Improve logging
- Improve custom options