@@ -304,29 +304,31 @@ if (module === require.main) {
304304 const mf = new Miniflare ( options ) ;
305305
306306 mf . getOptions ( )
307- . then ( async ( { host, port = defaultPort , processedHttps } ) => {
308- const secure = processedHttps !== undefined ;
309- ( await mf . createServer ( secure as any ) ) . listen ( port , host , async ( ) => {
310- const protocol = secure ? "https" : "http" ;
311- mf . log . info ( `Listening on ${ host ?? "" } :${ port } ` ) ;
312- if ( host ) {
313- mf . log . info ( `- ${ protocol } ://${ host } :${ port } ` ) ;
314- } else {
315- for ( const accessibleHost of getAccessibleHosts ( true ) ) {
316- mf . log . info ( `- ${ protocol } ://${ accessibleHost } :${ port } ` ) ;
307+ . then (
308+ async ( { host, port = defaultPort , processedHttps, disableUpdater } ) => {
309+ const secure = processedHttps !== undefined ;
310+ ( await mf . createServer ( secure as any ) ) . listen ( port , host , async ( ) => {
311+ const protocol = secure ? "https" : "http" ;
312+ mf . log . info ( `Listening on ${ host ?? "" } :${ port } ` ) ;
313+ if ( host ) {
314+ mf . log . info ( `- ${ protocol } ://${ host } :${ port } ` ) ;
315+ } else {
316+ for ( const accessibleHost of getAccessibleHosts ( true ) ) {
317+ mf . log . info ( `- ${ protocol } ://${ accessibleHost } :${ port } ` ) ;
318+ }
317319 }
318- }
319320
320- // Check for updates, ignoring errors (it's not that important)
321- if ( options . disableUpdater ) return ;
322- try {
323- // Get currently installed package metadata
324- const pkgFile = path . join ( __dirname , ".." , ".." , "package.json" ) ;
325- const pkg = JSON . parse ( await fs . readFile ( pkgFile , "utf8" ) ) ;
326- const cachePath = envPaths ( pkg . name ) . cache ;
327- await updateCheck ( { pkg, cachePath, log : mf . log } ) ;
328- } catch { }
329- } ) ;
330- } )
321+ // Check for updates, ignoring errors (it's not that important)
322+ if ( disableUpdater ) return ;
323+ try {
324+ // Get currently installed package metadata
325+ const pkgFile = path . join ( __dirname , ".." , "package.json" ) ;
326+ const pkg = JSON . parse ( await fs . readFile ( pkgFile , "utf8" ) ) ;
327+ const cachePath = envPaths ( pkg . name ) . cache ;
328+ await updateCheck ( { pkg, cachePath, log : mf . log } ) ;
329+ } catch ( e ) { }
330+ } ) ;
331+ }
332+ )
331333 . catch ( ( err ) => mf . log . error ( err ) ) ;
332334}
0 commit comments