| 8 | |
| 9 | export const incomingHandler = { |
| 10 | handle(incomingRequest, responseOutparam) { |
| 11 | const outgoingResponse = new OutgoingResponse(new Fields()); |
| 12 | let outgoingBody = outgoingResponse.body(); |
| 13 | { |
| 14 | let outputStream = outgoingBody.write(); |
| 15 | outputStream.blockingWriteAndFlush( |
| 16 | new Uint8Array(new TextEncoder().encode('Hello world!')), |
| 17 | ); |
| 18 | outputStream[Symbol.dispose](); |
| 19 | } |
| 20 | outgoingResponse.setStatusCode(200); |
| 21 | OutgoingBody.finish(outgoingBody, undefined); |
| 22 | ResponseOutparam.set(responseOutparam, { |
| 23 | tag: 'ok', |
| 24 | val: outgoingResponse, |
| 25 | }); |
| 26 | }, |
| 27 | }; |