GithubHelp home page GithubHelp logo

fancellu / zio-restful-webservice Goto Github PK

View Code? Open in Web Editor NEW
58.0 3.0 5.0 81 KB

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

Scala 99.30% HTML 0.70%
h2-database quill twirl zio zio-http scala zio-streams zio-cache zio-logging zio-actors

zio-restful-webservice's Introduction

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/

zio-restful-webservice's People

Contributors

fancellu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zio-restful-webservice's Issues

Cannot run the App on 8080

Hi,

Thanks for the excellent example of ZIO. It really helps a lot.

I started the project and cannot curl to all endpoints on 8080. However, I can curl to all 8082 endpoints. I run all the test cases and it works but still, I cannot curl to the 8080 port locally. I am 100% sure the 8080 port is not occupied by others... May I know why ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.