1. 기본값
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
getHello(): string {
return 'hello';
}
}
2. @Get()
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get('cat')
getHello(): string {
return 'hello';
}
}
3. @Controller()
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
@Controller('animal')
export class AppController {
constructor(private readonly appService: AppService) {}
@Get('cat')
getHello(): string {
return 'hello';
}
}