When learning something it's good to build stuff. Learning more about Elixir, here's an identicon generator.
This was initially part of Stephen Grider's Udemy course but I wanted to make it a service.
- Doctests
- Exposing an endpoint with Plug and Cowboy
- Poison for a JSON response
- Erlang egd to generate images
Feel free to have a play around with it.
To generate docs for the functions included run mix docs
and open doc/index.html
Prerequisites are you have to have Elixir installed.
Pull down this repo, cd into /identicon
and run mix deps.get
. Then run mix run --no-halt
Open up your browser to mix run --no-halt
To generate an Identicon go to http://localhost:8080/moosch or whatever string you want to use.
Test it all works locally by building the release with MIX_ENV=prod mix release identicon_generator
.
Then run PORT=8080 _build/prod/rel/identicon_generator/bin/identicon_generator start
and to go http://localhost:8080
If all working, build the docker image using docker build -t identicon-generator .
Once built you can run it with docker run --env PORT=4000 --publish 4000:4000 identicon-generator:latest
MIT Licensed. Use all you like at your own risky fun. Go nuts.
Happy coding λ