Questions tagged [zio-http]

ZIO Http is a Scala library for building HTTP apps. It is powered by ZIO and Netty and aims at being the defacto solution for writing, highly scalable and performant web applications using idiomatic Scala.

17 questions
4
votes
2 answers

zio-http (ZIO 2.x) application not starting with Scala 3

I have this simple application: import zhttp.http.* import zhttp.http.Method.GET import zhttp.service.Server import zio.* object HexAppApplication extends ZIOAppDefault { // Create HTTP route val app: HttpApp[Any, Nothing] =…
codependent
  • 23,193
  • 31
  • 166
  • 308
3
votes
1 answer

ZIO HTTP configuration for max request size

I want to upload a file using ZIO HTTP, but it gives 413 code, the payload is too large. I can't figure out how to change the configuration of the underlying Netty server to fix the issue. Any help would be appreciated.
RB_
  • 1,195
  • 15
  • 35
2
votes
1 answer

Scala, ZIO - how to return custom response in zio-http?

do you know how I can return custom object as zio-http response? I created simple class: final case class CustomerResponse(id: Int, name: String, age: Int) object CustomerResponse { implicit val responseCodec: Codec[CustomerResponse] =…
Developus
  • 1,400
  • 2
  • 14
  • 50
2
votes
3 answers

Sending zio http response from callback function

I am trying to play around with ZIO http using their simples hello world example. I have a Java-written service which does some logic, and it expecting a handler function, so it can call it when result is ready. How do I user it together with ZIO…
RB_
  • 1,195
  • 15
  • 35
1
vote
1 answer

ZioHttp end point - Return json response

I am creating a ZioHttp Rest endpoint... For a Json request I want to return Json response ... I'm able to retrun logs, print lines but not sure how to return json response... Here's my code: import zio.{Console, _} import zhttp._ import…
1
vote
0 answers

How did parameterizing this function make my Zio project stop working?

I've started writing a server that uses zio-http to forward messages from a Pulsar topic to a WebSocket. It was working fine, but I realized I was creating the consumer again when the socket was being closed, so I refactored that code to accept the…
Isvara
  • 3,403
  • 1
  • 28
  • 42
0
votes
0 answers

How to open a websocket connection using a custom POST request with body as the handshake in ZIO?

I'm working on a Scala client-server application using ZIO. My server exposes a RESTful API and must be able to handle WebSocket connections. I want to implement something similar to the way kubectl and the Kubernetes API server work, where a…
0
votes
1 answer

Using Guice as a dependency injection library in ZIO App

We are working on migrating our Play! application to ZIO. As a first step, we are checking if we can use the Google Guice as a dependency injection library in ZIO, so that changes could be minimal. It is mentioned here, but I didn't find any…
0
votes
3 answers

Upload json file from js frontend to zhttp backend

I have js code for upload json file with content {"name": "John", "age": 35} from frontend js with using POST to scala zhttp backend. JS code: