Skip to content

ZIO 2.0 Restful webservice example using zio, zio-http, zio-json, quill, H2, twirl, zio-streams, zio-cache, zio-logging, zio-actors, zio-spark, openai, DallE

Notifications You must be signed in to change notification settings

fancellu/zio-restful-webservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

ZIO 2.0 Restful webservice example using zio, zio-http, zio-json, quill, H2, twirl, zio-streams, zio-cache, zio-logging, zio-actors, zio-spark, openai, DallE

Topics

Resources

Stars

Watchers

Forks