Skip to content

Commit

Permalink
test: add all cases that the lib should act in
Browse files Browse the repository at this point in the history
  • Loading branch information
micalevisk committed Mar 30, 2024
1 parent bffa2c5 commit 2b23c2e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 3 additions & 2 deletions examples/simple-http-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
"@nestjs/common": "^10.3.7",
"@nestjs/core": "^10.3.7",
"@nestjs/platform-express": "^10.3.7",
"@nestjs/platform-fastify": "^10.3.7",
"reflect-metadata": "^0.2.2"
},
"devDependencies": {
"@nestjs/cli": "^10.3.2",
"@nestjs/schematics": "^10.1.1",
"@types/node": "^20.12.2",
"typescript": "^5.4.3",
"nestjs-devtools-loader": "file:../../nestjs-devtools-loader-1.1.0.tgz"
"nestjs-devtools-loader": "file:../../nestjs-devtools-loader-1.1.0.tgz",
"typescript": "^5.4.3"
}
}
17 changes: 14 additions & 3 deletions examples/simple-http-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { NestFactory } from '@nestjs/core';
import type { NestExpressApplication } from '@nestjs/platform-express';
import { FastifyAdapter } from '@nestjs/platform-fastify';
import { AppModule } from './app.module';

async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
// Use case 1: default adapter, default options
const app = await NestFactory.create(AppModule);

// Use case 2: custom adapter, default options
// const app = await NestFactory.create(AppModule, new FastifyAdapter());

// Use case 3: default adatper, custom options
// const app = await NestFactory.create(AppModule, { logger: ['debug'] });

// Use case 4: custom adatper, custom options
// const app = await NestFactory.create(AppModule, new FastifyAdapter(), { logger: ['debug'] });

await app.listen(process.env.PORT || 3000);
}
bootstrap();
bootstrap();

0 comments on commit 2b23c2e

Please sign in to comment.