Skip to content

wenhoujx/zio-rest-app-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala 3 + ZIO 2 rest app example

When I learn ZIO by myself, I was looking for example apps, but can't find many.

This is a simple ZIO 2 scala 3 rest app.

libraries

  • zio 2
  • zio-json for json ser/de
  • zio-http for http server
  • zio-logging for logging

releases

Please go to releases page to go through incremental implementation of this app. Each individual release is a working app.

run server

This server use in ram hashmap as DB, no docker needed.

Server will start on localhost:8080, go to health endpoint in your browser and you should see all good.

sbt run

run tests

sbt test

REST curl test

You can find the http request examples in the test.http file.

TODOs

  • Add tests
  • add db connections
  • add instruction how to run this app locally
  • add curl examples
  • add logging
  • add zio metrics
  • add dockerfile

Similar projects