This is what I'm currently using, but what if I have many children routes? I don't want to have a single, fat Controller class. Ideally I would be able to create different child routes inside different Controller classes
i think you need this?
import {Controller, Get, Param} from "@nestjs/common";
@Controller('accounts/:account')
export class TestController{
@Get('resource2/:someParam/whatever')
arsPW(@Param('account') account, @Param('someParam') someparam){
console.log(':account/resource2/:someParam/whatever',account,someparam)
return account+'_'+someparam+'___';
}
@Get('resource1/:someparam')
aRSP(@Param('account') account, @Param('someparam') someparam){
console.log(':account/resource1/:someParam',account,someparam)
return account+'_'+someparam;
}
@Get()
getget(){
console.log('get');
return 'aaa';
}
}