File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 16
16
"@nestjs/common" : " ^10.3.7" ,
17
17
"@nestjs/core" : " ^10.3.7" ,
18
18
"@nestjs/platform-express" : " ^10.3.7" ,
19
+ "@nestjs/platform-fastify" : " ^10.3.7" ,
19
20
"reflect-metadata" : " ^0.2.2"
20
21
},
21
22
"devDependencies" : {
22
23
"@nestjs/cli" : " ^10.3.2" ,
23
24
"@nestjs/schematics" : " ^10.1.1" ,
24
25
"@types/node" : " ^20.12.2" ,
25
- "typescript " : " ^5.4.3 " ,
26
- "nestjs-devtools-loader " : " file:../../nestjs-devtools-loader-1.1.0.tgz "
26
+ "nestjs-devtools-loader " : " file:../../nestjs-devtools-loader-1.1.0.tgz " ,
27
+ "typescript " : " ^5.4.3 "
27
28
}
28
29
}
Original file line number Diff line number Diff line change 1
1
import { NestFactory } from '@nestjs/core' ;
2
- import type { NestExpressApplication } from '@nestjs/platform-express ' ;
2
+ import { FastifyAdapter } from '@nestjs/platform-fastify ' ;
3
3
import { AppModule } from './app.module' ;
4
4
5
5
async function bootstrap ( ) {
6
- const app = await NestFactory . create < NestExpressApplication > ( AppModule ) ;
6
+ // Use case 1: default adapter, default options
7
+ const app = await NestFactory . create ( AppModule ) ;
8
+
9
+ // Use case 2: custom adapter, default options
10
+ // const app = await NestFactory.create(AppModule, new FastifyAdapter());
11
+
12
+ // Use case 3: default adatper, custom options
13
+ // const app = await NestFactory.create(AppModule, { logger: ['debug'] });
14
+
15
+ // Use case 4: custom adatper, custom options
16
+ // const app = await NestFactory.create(AppModule, new FastifyAdapter(), { logger: ['debug'] });
17
+
7
18
await app . listen ( process . env . PORT || 3000 ) ;
8
19
}
9
- bootstrap ( ) ;
20
+ bootstrap ( ) ;
You can’t perform that action at this time.
0 commit comments