best practice for custom http responses #7174
Replies: 4 comments
-
@TomerSalton, do you mean to change the HTTP response outside the controller? |
Beta Was this translation helpful? Give feedback.
-
Is there any plan to do first-class support on custom HTTP response (not just error-handling)? I've followed the solution on StackOverflow. However, this meant that the repository now expects an Otherwise, is there a way to create controller unit tests? |
Beta Was this translation helpful? Give feedback.
-
See an example at https://github.com/strongloop/loopback-next/blob/master/packages/rest/src/__tests__/unit/writer.unit.ts. |
Beta Was this translation helpful? Give feedback.
-
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
Beta Was this translation helpful? Give feedback.
-
Hey,
I want to change the HTTP response (both errors and message) that is returned by the server.
Two examples:
Would you be able to provide me the best practice of implementing those HTTP responses customizations?
Thanks alot for your help,
Tomer.
Beta Was this translation helpful? Give feedback.
All reactions