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

Function webHandler

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

Source from the content-addressed store, hash-verified

156 describe("fromWebHandler", () => {
157 test("basic GET request", async () => {
158 const webHandler = async (request: Request) => {
159 return new Response(`Hello from ${request.url}`, {
160 status: 200,
161 headers: { "Content-Type": "text/plain" }
162 })
163 }
164 const app = HttpApp.fromWebHandler(webHandler)
165 const handler = HttpApp.toWebHandler(app)
166 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