MCPcopy Create free account
hub / github.com/Effect-TS/effect / webHandler

Function webHandler

packages/effect/test/unstable/http/HttpEffect.test.ts:166–171  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

164 describe("fromWebHandler", () => {
165 test("basic GET request", async () => {
166 const webHandler = async (request: Request) => {
167 return new Response(`Hello from ${request.url}`, {
168 status: 200,
169 headers: { "Content-Type": "text/plain" }
170 })
171 }
172 const app = HttpEffect.fromWebHandler(webHandler)
173 const handler = HttpEffect.toWebHandler(app)
174 const response = await handler(new Request("http://localhost:3000/hello"))

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
jsonMethod · 0.45

Tested by

no test coverage detected