Is it possible to make this into an API?
nyamwaya opened this issue · 4 comments
nyamwaya commented
Is it possible to make this into an API?
nyamwaya commented
Absolutely! Let me know which way we should take it and I will definitely help :)
peterpme commented
Hey @nyamwaya
That would be awesome! Here are some cool things that I would try:
- Puppeteer - this lets you spin up a headless chrome browser in the cloud, have it point to something and then it will generate a screenshot.
What we can do is create a new page like /get
and pass in query params: /get?hair=Bob
. The app will read the query params and use SvgLoader
to render a 512 x 512 image.
Since this is the only thing on the page, the screenshot should work.
- Node canvas
What we can do is hit a URL that consumes a set of query params and builds the DOM on the Node side. Node takes a photo of the image and returns it with the octect/stream
or w/e header so it shows up as an image.
Let me know what you think!!