RESTful 风格设计

  1. 接口 URL 风格
  2. 版本控制
  3. code 码规范

在 main.ts 文件中配置

import {VersioningType } from '@nestjs/common';
app.enableVersioning({ type: VersioningType.URI });

在 controller 中使用

// 类
@Controller({
  path: '',
  version: '1', 
})
// 方法
@Version('1')