install
$ npm i -g @nestjs/cli
$ nest new project-name
src
|---app.controller.ts
|---app.module.ts
|---main.ts
| .ts | ||
|---|---|---|
| app.controller.ts | Basic controller sample with a single route.【带有单个路由的基本控制器示例】 | |
| app.module.ts | The root module of the application.【应用程序的根模块】 | |
| main.ts | The entry file of the application which uses the core function NestFactory to create a Nest application instance.【应用程序入口文件。它使用 NestFactory 用来创建 Nest 应用实例】 |
本文介绍如何使用NestJS CLI创建新的NestJS项目,并详细解释了项目中包含的app.controller.ts、app.module.ts和main.ts等核心文件的作用。
992





