I would like to convert an RxJs Observable that emits data to a nodeJS stream so I can stream this data in chunks via a nodeJS application endpoint.
Is this even possible?
Pseudo code in a nodeJS router (obviously not working):
out.post('/data', [
body().isArray(),
], (req: Request, res: Response, next: NextFunction) => {
const errors = validationResult(req);
if (!errors.isEmpty()) {
next(new RequestValidationFailedError(errors.array()[0]));
}
const observable = service.getData(req.context);
req.pipe(observable);
});