Welcome to my ZIO playground. After I visited a scala meetup where Wiem presented the ZIO framework, I knew I had to dig into this.
I included my favourite frameworks:
- http4s
- circe
- doobie
- postgres
- pureconfig
It's a really simple app and just has to http access point:
- Show alle existing users in a database via the Root route
- Allow existing users too authenticate via the /secure route
As always, check out the git repo:
git clone git@github.com:don41382/zio-http4s-doobie-auth-example.git
Compose the docker instance, to have access to a postgres instance on port 54320
docker-compose up -d
And in the end, run sbt with the sbt-resolver plugin command
sbt "~reStart"
Done! Now you can play around. Change things and make your own picture of the awesomeness of zio.
Login to the secure area
- Username: "Felix", password: "password"
- Username: "Klaus", password: "123456"
This project also helped me to understand, how to catch defect in http4s.
For more details, checkout the issue on this.
Just a quick thanks for the support to Wiem and Kai for helping me to understand the error handling in ZIO/http4s.