Handling Multiple Routes in an Effect HTTP API

Hey all,

I'm setting up a HTTP API using Effect. I'm building the handlers out for the Live implementation, but I was wondering if there were any existing examples for how multiple routes are handled within a group? The examples in the README only concern themselves with handling one of the requests, e.g.

const usersGroupLive = HttpApiBuilder.group(api, "users", (handlers) =>
  handlers.handle("getUser", (req) =>
    Effect.succeed({
      id: req.path.id,
      name: "John Doe",
      createdAt: DateTime.unsafeNow()
    })
  )
).pipe(
  // Provide the Logger middleware to the group
  Layer.provide(LoggerLive)
)


If there are any existing resources going over this in more depth, please do let me know! 👀
Was this page helpful?