You can stream data using the response.sendStream()
method. This method allows you to send a readable stream as the response body. You can create a readable stream using Node.js' stream
module or any other library that provides readable streams. Here's an example:
import { HttpRequest, HttpResponse } from '@deepkit/http'; import { createReadStream } from 'fs'; router.get('/image', (request: HttpRequest, response: HttpResponse) => { const stream = createReadStream('/path/to/image.jpg'); response.sendStream(stream, 'image/jpeg'); });