File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ module.exports = function(config) {
19
19
list . push ( { name, start, stop } ) ;
20
20
}
21
21
22
- app . start = async ( ) => {
22
+ app . start = async ( opts = { } ) => {
23
23
debug ( 'app.start' ) ;
24
24
for ( const item of list ) {
25
25
if ( typeof item . start === 'function' ) {
@@ -28,10 +28,13 @@ module.exports = function(config) {
28
28
}
29
29
}
30
30
31
- const port = ( config . server || { } ) . port || 3000 ;
32
- const server = app . listen ( port ) ;
33
- global . console . log ( `server listen at: ${ port } ` ) ;
34
- return server ;
31
+ const { listen = true } = opts ;
32
+ if ( listen ) {
33
+ const port = ( config . server || { } ) . port || 3000 ;
34
+ const server = app . listen ( port ) ;
35
+ global . console . log ( `server listen at: ${ port } ` ) ;
36
+ return server ;
37
+ }
35
38
} ;
36
39
37
40
app . stop = async ( ) => {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " avada" ,
3
- "version" : " 1.4.0 " ,
3
+ "version" : " 1.5.0-beta.1 " ,
4
4
"description" : " A nodejs web framework basedon koa." ,
5
5
"main" : " lib/index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments