Issues with HttpClient in an example code

Struggling with the HttpClient (basic). I see this code in an example in the repo

 const defaultClient = yield* _(Http.client.Client)
 const clientWithBaseUrl = defaultClient.pipe(
    Http.client.filterStatusOk,
    Http.client.mapRequest(Http.request.prependUrl("https://jsonplaceholder.typicode.com"))
  )


When I write this code it errors. Now I understand (I think) that the _ is not needed anymore.

Really, i'm trying to learn effect by writing a pass through layer between a client and a server, so all I really care about is taking a request and then passing it to a different server. Think like a BFF layer.

So I think my steps are - create a client, map a new url on that client, send request with that post body.

Where am I going wrong that

yield* Http.client.Client


just errors?

yield* post(authenticate_route, (req, res) => {
    Effect.gen(function* () {
      const client = yield* Http.client.Client; <- unhappy code

      
    })
Was this page helpful?