File tree Expand file tree Collapse file tree 5 files changed +17
-17
lines changed
part-1-web-server-basics/hr_app
part-2-database-basics/hr_app Expand file tree Collapse file tree 5 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ async function startup() {
44 console . log ( 'Starting application' ) ;
55
66 try {
7- console . log ( 'Starting web server' ) ;
7+ console . log ( 'Initializing web server module ' ) ;
88
9- await webServer . start ( ) ;
9+ await webServer . initialize ( ) ;
1010 } catch ( err ) {
1111 console . error ( err ) ;
1212
@@ -22,9 +22,9 @@ async function shutdown(e) {
2222 console . log ( 'Shutting down' ) ;
2323
2424 try {
25- console . log ( 'Closing web server' ) ;
25+ console . log ( 'Closing web server module ' ) ;
2626
27- await webServer . stop ( ) ;
27+ await webServer . close ( ) ;
2828 } catch ( e ) {
2929 console . log ( 'Encountered error' , e ) ;
3030
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const webServerConfig = require('../config/web-server.js');
55
66let httpServer ;
77
8- function start ( ) {
8+ function initialize ( ) {
99 return new Promise ( ( resolve , reject ) => {
1010 const app = express ( ) ;
1111 httpServer = http . createServer ( app ) ;
@@ -30,11 +30,11 @@ function start() {
3030 } ) ;
3131}
3232
33- module . exports . start = start ;
33+ module . exports . initialize = initialize ;
3434
3535// previous code above this line
3636
37- function stop ( ) {
37+ function close ( ) {
3838 return new Promise ( ( resolve , reject ) => {
3939 httpServer . close ( ( err ) => {
4040 if ( err ) {
@@ -47,4 +47,4 @@ function stop() {
4747 } ) ;
4848}
4949
50- module . exports . stop = stop ;
50+ module . exports . close = close ;
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ async function startup() {
2020 }
2121
2222 try {
23- console . log ( 'Starting web server' ) ;
23+ console . log ( 'Initializing web server module ' ) ;
2424
25- await webServer . start ( ) ;
25+ await webServer . initialize ( ) ;
2626 } catch ( err ) {
2727 console . error ( err ) ;
2828
@@ -38,9 +38,9 @@ async function shutdown(e) {
3838 console . log ( 'Shutting down application' ) ;
3939
4040 try {
41- console . log ( 'Closing web server' ) ;
41+ console . log ( 'Closing web server module ' ) ;
4242
43- await webServer . stop ( ) ;
43+ await webServer . close ( ) ;
4444 } catch ( e ) {
4545 console . error ( e ) ;
4646
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const database = require('./database.js');
66
77let httpServer ;
88
9- function start ( ) {
9+ function initialize ( ) {
1010 return new Promise ( ( resolve , reject ) => {
1111 const app = express ( ) ;
1212 httpServer = http . createServer ( app ) ;
@@ -35,9 +35,9 @@ function start() {
3535 } ) ;
3636}
3737
38- module . exports . start = start ;
38+ module . exports . initialize = initialize ;
3939
40- function stop ( ) {
40+ function close ( ) {
4141 return new Promise ( ( resolve , reject ) => {
4242 httpServer . close ( ( err ) => {
4343 if ( err ) {
@@ -50,4 +50,4 @@ function stop() {
5050 } ) ;
5151}
5252
53- module . exports . stop = stop ;
53+ module . exports . close = close ;
You can’t perform that action at this time.
0 commit comments