({request})
| 3 | import {ActionFunction} from '@remix-run/node'; |
| 4 | |
| 5 | export const action: ActionFunction = async ({request}) => { |
| 6 | const runOptions = await request.json(); |
| 7 | |
| 8 | // 1. Initiate the Pipe. |
| 9 | const pipe = new Pipe(getPipeSummary()); |
| 10 | |
| 11 | // 2. Run the Pipe. |
| 12 | const {stream, threadId} = await pipe.run(runOptions); |
| 13 | |
| 14 | // 3. Return the ReadableStream directly. |
| 15 | return new Response(stream, { |
| 16 | status: 200, |
| 17 | headers: { |
| 18 | 'lb-thread-id': threadId ?? '', |
| 19 | }, |
| 20 | }); |
| 21 | }; |
nothing calls this directly
no test coverage detected