MCPcopy
hub / github.com/Effect-TS/effect / webHandler

Function webHandler

packages/platform/test/HttpApp.test.ts:143–148  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

141 describe("fromWebHandler", () => {
142 test("basic GET request", async () => {
143 const webHandler = async (request: Request) => {
144 return new Response(`Hello from ${request.url}`, {
145 status: 200,
146 headers: { "Content-Type": "text/plain" }
147 })
148 }
149 const app = HttpApp.fromWebHandler(webHandler)
150 const handler = HttpApp.toWebHandler(app)
151 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…