Avatar is a Go package that generates avatar from name.
Use docker to run the server:
docker build -t avatar-server .
docker run -t --rm -v ./assets:/avatar/assets -p 8080:8080 -d --name avatar-server avatar-server
or use docker-compose:
docker-compose build
docker-compose up -d
http://localhost:8080/api?name=John%20Doe
http://localhost:8080/api?name=John%20Doe&shape=square&width=200&height=200&backgroundColor=red&fontColor=white&fontFamily=Caprasimo&fontWeight=400&borderWidth=10&borderColor=blue&borderDash=10,10&borderRadius=50&padding=5
query parameter | type |
---|---|
name | string |
separator | string |
sensitive | string |
lowercase | boolean |
uppercase | boolean |
camelcase | boolean |
length | number |
wordLength | boolean |
query parameter | type |
---|---|
width | number |
height | number |
backgroundColor | string |
fontFamily | string |
fontWeight | string |
fontSize | number |
fontColor | string |
shape | string (circle, square) |
borderDash | string (css border dash) |
borderWidth | number |
borderRadius | number |
borderColor | string |
padding | number |
randomFontColor | boolean |
randomBorderColor | boolean |