( handler: (request: Request) => Promise<Response>, body: Uint8Array | string, headers?: Record<string, string>, path = "/" )
| 26 | } |
| 27 | |
| 28 | const post = ( |
| 29 | handler: (request: Request) => Promise<Response>, |
| 30 | body: Uint8Array | string, |
| 31 | headers?: Record<string, string>, |
| 32 | path = "/" |
| 33 | ) => |
| 34 | handler( |
| 35 | new Request(`http://localhost${path}`, { |
| 36 | method: "POST", |
| 37 | body: body as BodyInit, |
| 38 | ...(headers === undefined ? {} : { headers }) |
| 39 | }) |
| 40 | ) |
| 41 | |
| 42 | const readers = { |
| 43 | json: (request: HttpServerRequest.HttpServerRequest) => Effect.map(request.json, (json) => JSON.stringify(json)), |
no test coverage detected