(no title)
deadlyllama | 2 years ago
I'd rather describe the HTTP to method call mapping of my controller with decorators than a bunch of "add endpoint" calls. I like that the HTTP to code binding is located right beside the code itself.
I like that I can separate my app up into modules and couple them as loosely or tightly as I need.
You can architecture astronaut with NestJS, but you don't have to! I wrote a queue module (to interface with a legacy queue system), using decorators to specify the consumer. Docs on doing this are essentially nonexistent. The NestJS based library I cribbed from spread the "find the object & method to call" logic across multiple classes. I distilled it down to a screenful.
As with all tools, you get some choice in how you use it. Want to go wild with dependency injecting a zillion classes with one method each? If you really want to, I guess you can. Want to be sensible, for your definition of sensible? You can do that too.
No comments yet.