Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
939 changes: 54 additions & 885 deletions README.md

Large diffs are not rendered by default.

1,971 changes: 874 additions & 1,097 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "crud",
"name": "a",
"version": "0.0.1",
"description": "",
"author": "",
Expand All @@ -24,16 +24,9 @@
"@nestjs/common": "^7.5.1",
"@nestjs/core": "^7.5.1",
"@nestjs/platform-express": "^7.5.1",
"@nestjs/swagger": "^4.7.12",
"@nestjs/typeorm": "^7.1.5",
"class-transformer": "^0.3.2",
"class-validator": "^0.13.1",
"mongodb": "^3.6.4",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.6.3",
"swagger-ui-express": "^4.1.6",
"typeorm": "^0.2.30"
"rxjs": "^6.6.3"
},
"devDependencies": {
"@nestjs/cli": "^7.5.1",
Expand Down
Binary file removed picture/0.png
Binary file not shown.
Binary file removed picture/1.png
Binary file not shown.
Binary file removed picture/2.png
Binary file not shown.
Binary file removed picture/3.png
Binary file not shown.
Binary file removed picture/4.png
Binary file not shown.
Binary file removed picture/5.png
Binary file not shown.
Binary file removed picture/6.png
Binary file not shown.
19 changes: 2 additions & 17 deletions src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { TodoListModule } from './todo-list/todo-list.module';
import { TodoItem } from './todo-list/todo-item.entity';

@Module({
imports: [
TodoListModule,
TypeOrmModule.forRoot({
type: 'mongodb', //我用的是mongodb ,可选其他TypeORM 支持的数据库,安装好依赖
host: 'localhost',
port: 27017, //数据库端口号,mongodb默认27017
//username: 'root', 因为mongodb 的连接不用 账号密码, 所以我这边注释了,如果你的数据库要密码的话,要写上去。
//password: 'root',
database: 'nest', //
entities: [TodoItem],
synchronize: true,
logging: false,
}),
],
imports: [],
controllers: [AppController],
providers: [AppService],
})
Expand Down
14 changes: 2 additions & 12 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe());

const options = new DocumentBuilder()
.setDescription('The todoList API description')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api', app, document);
const port = process.env.PORT || 3000;
await app.listen(port);
await app.listen(3001);
}
bootstrap();
7 changes: 0 additions & 7 deletions src/todo-list/dto/add-todo-item.dto.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/todo-list/dto/update-todo-item.dto.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/todo-list/interfaces/item.interface.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/todo-list/todo-item.entity.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/todo-list/todo-list.controller.spec.ts

This file was deleted.

80 changes: 0 additions & 80 deletions src/todo-list/todo-list.controller.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/todo-list/todo-list.module.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/todo-list/todo-list.service.spec.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/todo-list/todo-list.service.ts

This file was deleted.