Open 8bitreid opened 2 years ago
The documentation is really here. I can't find anywhere how to provide layers to my app. With io.d11 was as simple as Server .start(8080, endpoints) .provide( Layer1.live, Layer2.live)
The documentation is really here. I can't find anywhere how to provide layers to my app.
With io.d11 was as simple as
Server
.start(8080, endpoints) .provide( Layer1.live, Layer2.live)
Does this work?
https://github.com/8bitreid/zio-examples/blob/main/src/main/scala/example/zhttp/ZhttpServer.scala
Yeah, that helps, thanks
What is not easy to do right now? It is not clear how to get started using zhttp with a dependency for your HttpApp or something for your
R
Describe the solution you'd like A simple example of HttpApp where there is an
R
that does the "logic" doesn't have to be anything complex.Why is it important? This is a great project, but to newcomers the idea of returning raw string text or json is not appealing. This will give a clear and straightforward example of how to pick up and put zhttp on top of an existing service.
Additional context For an existing project in other frameworks I know how to write a service with functions
A => B
but in the examples here all I see are examples ofPath => String
and this is quick and easy. However, if I have a dependency likeServiceA
there are no examples withR
on any documentation.