Skip to content

Latest commit

 

History

History
143 lines (106 loc) · 4.24 KB

README.md

File metadata and controls

143 lines (106 loc) · 4.24 KB

ZIO Restful webservice example

Using zio 2.0, zio-http, zio-json, quill, H2, twirl, zio-logging, zio-cache, zio-actors, zio-spark, openai

Now targeting zio-http 0.0.3

Apps

NoEnvApp

(no use of Environment)

HelloWorldApp

(Takes a String param via serviceAt Map as app root name)

HelloWorldTwirlApp

(Takes a String param and uses Twirl for HTML rendering)

DownloadApp

(Downloads a file in one go, and streaming, slowly)

CounterApp

(Stateful use of Ref)

VideoApp

(In memory and H2+Quill)

DelayApp

(Semantically sleeps for a while, no thread blocking, useful for emulating slow queries)

StreamApp

(Some streaming examples)

ClientApp

(Client examples talking to external web service https://jsonplaceholder.typicode.com/)

Downloads anime from https://api.waifu.pics/many/sfw/waifu into resources/waifu dir

StaticApp

(Static file server from static dir)

ActorsApp

OpenAICompletionApp

(Modelled after https://github.com/openai/openai-quickstart-python.git)

To use it you'll have to fill in your OpenAI OPENAI_API_KEY

OpenAIDallEApp

OpenAIModerationApp

CookieAuthApp

FormApp

Parallel server on port 8082

To run

sbt run

You should find it running on http://localhost:8080/