Effect CommunityEC
Effect Community7mo ago
24 replies
Coda-Cola

Create a layer effectfully

I'm using NodeHttpServer.layer to create a layer, this method can accept an optional port parameter.

I would like to use the portfinder library to first identify a free port for this param. Portfinder has a getPortPromise method that I can trivially wrap in an effect.

Used in combination, This would allow me to get an Effect<Layer<...>>, but I just need a straight Layer

I've attempted using Layer.unwrapEffect, but when I tried this approach the web service within my application isn't started. How should I be doing it instead?
Was this page helpful?