I want some help to build a structure for my node.js application.
My requirement is:
Req R1 will come to say endpoint E1, with a payload P1 (having callback url (say U1) as well), I will validate R1 and if it pass some of the basic validations I have to make a new "POST" req R2 on some predefined URL U2 and send response RS1 cooresponding to R1. But I don't want to wait for response from R2 (I just want to POST the request if R1 is valid). If R1 is invalid, I don't want to POST the request R2; in any case, i have to send response to R1.
I know, it's might be too long, but I just want help in choosing the correct approach.