Using zio 2.0, zio-http, zio-json, quill, H2, twirl, zio-logging, zio-cache
(no use of Environment)
(Takes a String as app root name)
- http://localhost:8080/hello
- http://localhost:8080/hello/Dino
- http://localhost:8080/hello?name=Dino&name=Milo
(Takes a String param and uses Twirl for HTML rendering)
(Downloads a file in one go, and streaming, slowly)
(Stateful use of Ref)
- http://localhost:8080/up
- http://localhost:8080/down
- http://localhost:8080/get
- http://localhost:8080/reset
(In memory and H2+Quill)
- POST http://localhost:8080/videos/:name
- http://localhost:8080/videos
- http://localhost:8080/videos/loadup
- http://localhost:8080/videos/:name
(Semantically sleeps for a while, no thread blocking, useful for emulating slow queries)
- http://localhost:8080/delay
- http://localhost:8080/delay/2
- http://localhost:8080/bang
- http://localhost:8080/bangrandomly
(Some streaming examples)
- http://localhost:8080/stream/incrementing
- http://localhost:8080/stream/randomInt
- http://localhost:8080/stream/videos
- (Make sure you have some videos in DB, perhaps call http://localhost:8080/videos/loadup)
(Client examples talking to external web service https://jsonplaceholder.typicode.com/)
- http://localhost:8080/client/users
- http://localhost:8080/client/users/1 (Is Cached, TTL 15 seconds)
- http://localhost:8080/client/posts
- http://localhost:8080/client/posts/1
- http://localhost:8080/client/posts/userId/1
- http://localhost:8080/client/dopost
(Static file server from static dir)
- http://localhost:8080
- http://localhost:8080/subdir
- http://localhost:8080/subdir/test3.txt
- http://localhost:8080/test.txt
- http://localhost:8080/test2.txt
sbt run
You should find it running on http://localhost:8080/