NestJS · Senior · Question 21 of 75
What does hexagonal (ports and adapters) architecture look like in Nest?
- 1Every module exposes exactly six controllers
- ✓Correct answer: Domain services depend on interfaces (ports) injected by tokens; adapters implement them (DB, HTTP clients, queues) and are bound in modules
- 3All code lives in controllers
Explanation
Swapping adapters in tests or migrations becomes a module configuration change, not a rewrite.