File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1014,12 +1014,19 @@ export async function main(options: IServerOptions): Promise<void> {
1014
1014
} else if ( typeof options . port === 'number' ) {
1015
1015
port = options . port ;
1016
1016
}
1017
+
1017
1018
const host = parsedArgs . host || '0.0.0.0' ;
1019
+ server . on ( 'error' , ( ) => {
1020
+ server . close ( ) ;
1021
+ process . exit ( 1 ) ;
1022
+ } ) ;
1023
+
1018
1024
server . listen ( port , host , ( ) => {
1019
1025
const addressInfo = server . address ( ) as net . AddressInfo ;
1020
1026
const address = addressInfo . address === '0.0.0.0' || addressInfo . address === '127.0.0.1' ? 'localhost' : addressInfo . address ;
1021
- const port = addressInfo . port === 80 ? '' : String ( addressInfo . port ) ;
1022
- logService . info ( `Web UI available at http://${ address } :${ port } ` ) ;
1027
+ const formattedPort = addressInfo . port === 80 ? '' : String ( addressInfo . port ) ;
1028
+ logService . info ( `Web UI available at http://${ address } :${ formattedPort } ` ) ;
1023
1029
} ) ;
1030
+
1024
1031
} ) ;
1025
1032
}
You can’t perform that action at this time.
0 commit comments