Simple scala app which is created web-socket using http4s and cats and relying on the divisor (integer parameter within our route) works with streams using core+io fs2 and fs2-kafka.
Within application, we have 3 possible cases 🚀️ 🚀️ 🚀️ :
- http://localhost:8080/ws?divisor=3 (provide divisor)
- http://localhost:8080/ws?divisor (Didn't provide a divisor, then we will take default divisor using pure-config and read default value from yaml file)
- http://localhost:8080/ws?divisor=12 (provide a divisor greater than rows in .csv file, as a result we will see message)
We have two different run options:
- Run app using Docker
- Run app using simple sbt
-
Download project
-
Create .jar file using sbt assembly plugin next name
ICEOTask-assembly-0.2.jar
-
From project folder create Docker image
docker build -t my-application .
-
Run docker container
docker run -p 8080:8080 my-application
-
Сheck with Curl the cases I gave above.
As a result you should see: P.S. sorry about this responces, but docker container didn't understand \n , so that is the reason why the answers look a little strange, but the normal answers can be seen below in the following pictures.
I'm also created several simple scala test, for run it use sbt test
command