(request: Request)
| 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")) |