Spinney is a Puppeteer-as-a-service app designed to be a headless Rails app that proxies the appropriate request to Puppeteer via the Grover gem, and returns the rendered result. It is designed to run on the Heroku and AWS free tiers (probably).
Its only initial requirement is to take HTML input and spit out a JPEG, but we'd like to support the entire Grover configuration surface as early as possible.
TBD
POST /convert
{
"api_key": "xxxxxxxxxxxxxxxxxx",
"html": "<html><body>Hello world</body></html>"
}
TBD
{
"image_data": "/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAA\nAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAA\nAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAAB\noAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0\nAAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAE...."
}
API keys are managed through Rake tasks. This means that you must have access to the command line of the machine running Spinney. Since this is a backend-facing product that's the easiest to handle at the moment.
Note: If you're using Z shell/zsh, which is the default new command line on MacOS, you may need to wrap commands in '
(single apostrophe) such as rails 'keys:new[Dubric Ergyng]'
.
List all api keys in the system
rails keys:list
id: 1 | name: Kevin Glendalough | last_used: 2020-01-17T02:31:08 | key: 5d6daacd76019e39eb49b5a6b4ebaf7e
id: 2 | name: Ciarán Saigir | last_used: 2020-01-17T02:31:08 | key: 5d6daacd76019e39eb49b5a6b4ebaf7e
Create a new api key
rails keys:new[Elfodd Gwynedd]
New key generated ⚙️
--------------------------------------------
id: 2 | name: Elfodd Gwynedd | last_used: Never | key: e984ddb6e40706014acfe206bdc59c21
Delete an api key
rails keys:delete[12]
Successfully deleted key #2
TBD
Note: All sample names in the documentation should be those of Celtic bishops or saints prior to romanization of the church. In cases where no surname is known, add the city of birth or known city of origin. You can find some here: https://en.wikipedia.org/wiki/Celtic_Christianity