File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ValidationPipe } from '@nestjs/common' ;
22import { NestFactory } from '@nestjs/core' ;
3+ import { ConfigService } from '@nestjs/config' ;
34import { AppModule } from './app.module' ;
4- import { AppConfigService } from './common/config/app-config.service' ;
55
66async function bootstrap ( ) {
77 const app = await NestFactory . create ( AppModule ) ;
8- const appConfigService = app . get ( AppConfigService ) ;
9-
10- app . setGlobalPrefix ( appConfigService . apiPrefix ) ;
8+ const configService = app . get ( ConfigService ) ;
119
1210 app . useGlobalPipes (
1311 new ValidationPipe ( {
@@ -16,7 +14,7 @@ async function bootstrap() {
1614 transform : true ,
1715 } ) ,
1816 ) ;
19-
20- await app . listen ( appConfigService . port ) ;
17+ const PORT = configService . get < number > ( 'port' ) || 3000 ;
18+ await app . listen ( PORT ) ;
2119}
2220bootstrap ( ) ;
You can’t perform that action at this time.
0 commit comments