feature: update to nest v5

This commit is contained in:
Kamil Myśliwiec
2018-03-26 21:19:56 +02:00
parent 4a63be4f10
commit f346875387
9 changed files with 4696 additions and 5 deletions
+4 -1
View File
@@ -1,9 +1,12 @@
import { Get, Controller } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
root(): string {
return 'Hello World!';
return this.appService.root();
}
}
+2 -1
View File
@@ -1,9 +1,10 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [],
controllers: [AppController],
components: [],
providers: [AppService],
})
export class AppModule {}
+8
View File
@@ -0,0 +1,8 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
root(): string {
return 'Hello World!';
}
}
+15
View File
@@ -0,0 +1,15 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
declare const module: any;
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
if (module.hot) {
module.hot.accept();
module.hot.dispose(() => app.close());
}
}
bootstrap();