File tree 1 file changed +3
-10
lines changed
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ async function runFastify(opts: Args) {
121
121
} ) ;
122
122
123
123
const routes : RouteOptions [ ] = [ ] ;
124
-
124
+ fastifyInstance . decorate ( '$addedRoutes' , routes ) ;
125
125
fastifyInstance . addHook ( 'onRoute' , routeOptions => {
126
126
routes . push ( routeOptions ) ;
127
127
} ) ;
@@ -192,19 +192,12 @@ async function runFastify(opts: Args) {
192
192
address = await fastifyInstance . listen ( opts . port ) ;
193
193
}
194
194
195
- const showAddress = address === `0. 0.0.0: ${ opts . port } ` ? ` ${ getOuterIP ( ) } : ${ opts . port } ` : address ;
196
-
195
+ const showAddress = address . replace ( ' 0.0.0.0' , getOuterIP ( ) ) ;
196
+ console . log ( `Server listening on ${ showAddress } .` ) ;
197
197
for ( const route of routes ) {
198
198
console . log ( '——' , `${ showAddress } ${ route . url } (${ route . method } )` ) ;
199
199
}
200
200
201
- console . log ( `Server listening on ${ address } .` ) ;
202
- for ( const route of routes ) {
203
- console . log ( '——' , `${ address } ${ route . url } (${ route . method } )` ) ;
204
- }
205
-
206
- fastifyInstance . decorate ( '$addedRoutes' , routes ) ;
207
-
208
201
// for pm2 graceful start
209
202
if ( process . send ) {
210
203
process . send ( 'ready' ) ;
You can’t perform that action at this time.
0 commit comments