Coding task · NestJS course · Module 1: NestJS Basics

Dependency Injection in the Controller

Inject a service into the controller through the constructor.

Task

Write a LegionController with the @Controller('legions') decorator that receives LegionService through the constructor and, in a findAll() method with the @Get() decorator, returns the result of this.legionService.findAll().