MCPcopy Index your code
hub / github.com/Effect-TS/effect / searchParamsParser

Function searchParamsParser

packages/platform/src/internal/httpMiddleware.ts:202–216  ·  view source on GitHub ↗
(httpApp: App.Default<E, R>)

Source from the content-addressed store, hash-verified

200
201/** @internal */
202export const searchParamsParser = <E, R>(httpApp: App.Default<E, R>) =>
203 Effect.withFiberRuntime<
204 HttpServerResponse,
205 E,
206 ServerRequest.HttpServerRequest | Exclude<R, ServerRequest.ParsedSearchParams>
207 >((fiber) => {
208 const context = fiber.currentContext
209 const request = Context.unsafeGet(context, ServerRequest.HttpServerRequest)
210 const params = ServerRequest.searchParamsFromURL(new URL(request.originalUrl))
211 return Effect.locally(
212 httpApp,
213 FiberRef.currentContext,
214 Context.add(context, ServerRequest.ParsedSearchParams, params)
215 ) as any
216 })
217
218/** @internal */
219export const cors = (options?: {

Callers

nothing calls this directly

Calls 2

unsafeGetMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected