Parsing Search Parameters in "@effect/platform/HttpRouter"

Using "@effect/platform/HttpRouter" package, how do I parse searchParams on a specific route?

import * as HttpRouter from "@effect/platform/HttpRouter"
import * as HttpServerRequest from "@effect/platform/HttpServerRequest"

const handler = (req: HttpServerRequest.HttpServerRequest) => Effect.gen(function* () {
// How do I define/get the searchParams from the request. Is there a router specific method or do I need to construct the url myself and then parse it?
})

const route = HttpRouter.get("/test", Effect.flatMap(HttpServerRequest.HttpServerRequest, handler));
Was this page helpful?