Controller in nestjs

Controller

快速生成

1
$ nest generate controller [name]

基本使用

1
2
3
4
5
6
7
8
9
// `cats`作为路径前缀
@Controller('cats')
export class CatController {
// get http请求
@Get()
findAll(): string {
return 'This action returns all cats';
}
}

本文作者: 孟 虎
本文链接: https://menghu1994.github.io/blog/2024/09/Nodejs/NestJs/Controller/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!