A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
npm run build
Open dist folder in your file system to check output.
npm run build:sdk
// 测试api用例
import { Configuration, PingApi } from './sdk';
// 这个config是公共的 作用于所有api
const config = new Configuration({
basePath: 'http://localhost:3000',
});
class Test {
static instance = new Test();
constructor(private pingApi: PingApi = new PingApi(config)) {
this.init();
}
async init() {
try {
const result = await this.pingApi.pingControllerPing();
console.log(result.data);
} catch (error) {
console.log(error.message);
}
}
}
npm run migrate:g
npm run migrate:s
npm run migrate:r
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
# 查看命令帮助
$ nest -h
# 生成语法格式
$ nest g [<type>] [<name>] [<path>]
# generate model
$ nest g mo [<name>]
# generate controller
$ nest g co [<name>]
# generate service
$ nest g s [<name>]
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.