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

Function webHandler

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

Source from the content-addressed store, hash-verified

660 describe("fromWebHandler", () => {
661 test("basic GET request", async () => {
662 const webHandler = async (request: Request) => {
663 return new Response(`Hello from ${request.url}`, {
664 status: 200,
665 headers: { "Content-Type": "text/plain" }
666 })
667 }
668 const app = HttpEffect.fromWebHandler(webHandler)
669 const handler = HttpEffect.toWebHandler(app)
670 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