Friday 26 April 2019

NestJS, let services handle the complex stuff?

I just started working with NestJS and in the documentation I read something about services. For as far I understand controllers are used to catch HTTP requests and call a method from a service that is injected into the controller to handle the more complex stuff.This seems unnecessary to me, why should I call a seperate function from another class if I could manage to do that complex stuff just as good as in the controller method itself? I could see why services would be useful. for example if multiple controllers need to use the same logic.

Submitted April 26, 2019 at 07:55PM by Beurni

No comments:

Post a Comment