htmltopdf
Simple HTTP client for generating PDFs in Scala
Install
Make sure to Install Docker
Build Development Image
docker build -t htmltopdf_dev -f Dockerfile.dev .
Run Development Image for Development
docker run -it -v $(pwd)/play:/root/ -p 9000:9000 htmltopdf_dev ./activator ~run
After it starts up, you should be able to go to http://localhost:9000
(If you're on OS X, you'll need to get the IP of your VM)
Simple test url: localhost:9000?url=https://www.google.com&filename=test
Run Some Tests
docker run -it -v $(pwd)/play:/root/ htmltopdf_dev test
Building code for Production
# This will pack the application to be run on the production image.
docker run -it -v $(pwd)/play:/root/ htmltopdf_dev build
Build Production Image
docker build -t htmltopdf .
Run Production Image
docker run -d -p 9000:9000 htmltopdf run
Usage
There are only 2 API calls.
Path | Method | Params |
---|---|---|
/ | GET | url, filename |
/ | POST | html, filename |