draftbit / avatar-generator

Personas, an avatar generator by Draftbit

Home Page:https://personas.draftbit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to make this into an API?

nyamwaya opened this issue · comments

Is it possible to make this into an API?

Hey @nyamwaya,

We totally could! Would you be interested in helping?

Absolutely! Let me know which way we should take it and I will definitely help :)

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!!

Hey @nyamwaya are you still interested? If you are, feel free to re-open this issue. Thanks!