In Node.js using the LoopBack framework, I want to catch all responses that I have send to the client.
return cb(null, {
success: true,
msg: "Customer successfully fatch",
data: {}
});
I want to convert all response for language conversion after all processing.
Can I use any node module for that or is there any other way to implement it?
You should use Remote Hooks to hook before/after API calls.
The specific one you are looking at is afterRemote()
Example:
Car.afterRemote('revEngine', function(context, remoteMethodOutput, next) {
console.log('Turning off the engine, removing the key.');
// context.res is your Express Response object.
next();
});