File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed
Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ let config = {
5151 console : {
5252 use : true ,
5353 quiet : false ,
54+ exit : false ,
5455 } ,
5556
5657 views : {
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export default new class {
9797 logger . info ( 'hooks missing or invalid' ) ;
9898 }
9999
100- hooks ?. before_startup ?. ( ) ;
100+ await hooks ?. before_startup ?. ( ) ;
101101
102102 /**
103103 * initialize database connection and models
@@ -128,6 +128,12 @@ export default new class {
128128 } else {
129129 logger . error ( `no script called ${ command } found` ) ;
130130 }
131+
132+ await hooks ?. before_shutdown ?. ( ) ;
133+
134+ if ( config . console . exit ) {
135+ process . exit ( 0 ) ;
136+ }
131137 } else {
132138 /**
133139 * initiate the express module
@@ -137,7 +143,7 @@ export default new class {
137143 await init_express ( ) ;
138144 }
139145
140- hooks ?. after_startup ?. ( ) ;
146+ await hooks ?. after_startup ?. ( ) ;
141147 } catch ( err ) {
142148 logger . error ( 'exa uncaught exception:' ) ;
143149 handle_fatal_logging ( err ) ;
Original file line number Diff line number Diff line change 22 "name" : " @exajs/core" ,
33 "type" : " module" ,
44 "author" : " Brian Seymour <@realtux>" ,
5- "version" : " 0.0.26 " ,
5+ "version" : " 0.0.27 " ,
66 "description" : " modern opinionated node.js framework" ,
77 "license" : " MIT" ,
88 "homepage" : " https://github.com/realtux/exa" ,
Original file line number Diff line number Diff line change 11export default new class {
22
33 // runs before starting any modules but after configuration was loaded
4- before_startup ( ) {
4+ async before_startup ( ) {
55
66 }
77
88 // runs after all modules have finished starting up
9- after_startup ( ) {
9+ async after_startup ( ) {
10+
11+ }
12+
13+ // runs before a console command terminates
14+ async before_shutdown ( ) {
1015
1116 }
1217
You can’t perform that action at this time.
0 commit comments