File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,8 +59,8 @@ const sslOpts = {
5959 cert : require ( 'fs' ) . readFileSync ( 'fullchain.pem' ) ,
6060} ;
6161
62- http . createServer ( app ) . listen ( 80 ) ;
63- https . createServer ( sslOpts , app ) . listen ( 443 ) ;
62+ var httpServer = http . createServer ( app ) . listen ( 80 ) ;
63+ var httpsServer = https . createServer ( sslOpts , app ) . listen ( 443 ) ;
6464
6565let calledClose = false ;
6666
@@ -75,8 +75,11 @@ process.on('exit', function () {
7575process . on ( 'SIGINT' , function ( ) {
7676 console . log ( 'Got SIGINT. Trying to exit gracefully.' ) ;
7777 calledClose = true ;
78- server . close ( function ( ) {
79- console . log ( "Exoress server closed. Asking process to exit." ) ;
80- process . exit ( )
78+ httpServer . close ( function ( ) {
79+ httpsServer . close ( function ( ) {
80+ console . log ( "HTTP and HTTPS servers closed. Asking process to exit." ) ;
81+ process . exit ( )
82+ } ) ;
83+
8184 } ) ;
8285} ) ;
You can’t perform that action at this time.
0 commit comments