, have you tried NestJS? With its dependency injection your controller is totally unaware of whether the user or email service is an AWS service, in-memory service, stub service, etc. The controller just knows there will be an addUser method to the user service and what that service does under the hood, the controller doesn't know or care.
Anything to help separate concerns (and reuse and testing!)
I haven't tried it out yet, but will play around with it soon (I keep seeing it mentioned lately)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.