Seeking Help with NodeRuntime.runMain for Reusable Project

Hi everyone, I am building a pet project that will be reusable for future projects. I am struggling with how to run this on NodeRuntime.runMain pipe:

export const ProductsController = HttpRouter.empty.pipe(HttpRouter.get('/:id', productGetById.pipe(Effect.flatten)))
})

on
...
ProductsController.pipe(
  Effect.map(HttpServer.serve()),
  Layer.unwrapEffect,
  Layer.provide(Layer.merge(ServerLive, ProductServiceLive)),
  Layer.launch,
  NodeRuntime.runMain
)

full source-code: https://stackblitz.com/edit/vitejs-vite-ft5rtd?file=src%2Fmain.ts,src%2Fproducts%2Fproducts.controller.ts&terminal=dev

let me know if need some clarification.
Thanks in advance 🙂
Was this page helpful?