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