How to pass programatically generated req/res context to API controller functions? #9062
-
I'd like to receive requests via a RabbitMQ message that is packaged into a HTTP request, response context object and ultimately passed to my loopback middleware controllers. I've gotten up to the stage of packaging the message into a HTTP request/response object and I would now like to know how to pass it on to the middleware controllers. I'm assuming I'd need to pass the context to the sequence's handle function, but unclear how to set that up. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For posterity, I solved this via injecting the server to grab the sequence.
Could have also grabbed the sequence directly via its binding key |
Beta Was this translation helpful? Give feedback.
For posterity, I solved this via injecting the server to grab the sequence.
Could have also grabbed the sequence directly via its binding key
@inject(RestBindings.SEQUENCE) private sequence: MiddlewareSequence
, but was seeing errors injecting it with my pa…