@@ -254,31 +254,26 @@ async function run_browser(
254254 process . env . BROWSER = true
255255 process . on ( "SIGINT" , async ( ) => {
256256 console . log ( "Shutting down microservices" )
257- await Promise . all ( [
258- kill_back ( process . env . GEODE_PORT ) ,
259- kill_viewer ( process . env . VIEWER_PORT ) ,
260- ] )
257+ await Promise . all ( [ kill_back ( back_port ) , kill_viewer ( viewer_port ) ] )
261258 console . log ( "Quitting App..." )
262259 process . exit ( 0 )
263260 } )
264261
265- const nuxt_port = await get_available_port ( )
266- console . log ( "nuxt_port" , nuxt_port )
267-
268- process . env . NUXT_PORT = nuxt_port
269262 const nuxt_process = child_process . spawn ( "npm" , [ "run" , script_name ] , {
270263 shell : true ,
271264 } )
272265
273- return new Promise ( ( resolve , reject ) => {
266+ return new Promise ( ( resolve ) => {
274267 nuxt_process . stdout . on ( "data" , function ( data ) {
275268 const output = data . toString ( )
276269 const portMatch = output . match (
277270 / A c c e p t i n g \ c o n n e c t i o n s \ a t \ h t t p : \/ \/ l o c a l h o s t : ( \d + ) / ,
278271 )
279272 console . log ( "Nuxt: " , output )
280273 if ( portMatch ) {
281- resolve ( portMatch [ 1 ] )
274+ const nuxt_port = portMatch [ 1 ]
275+ process . env . NUXT_PORT = nuxt_port
276+ resolve ( { geode_port : back_port , viewer_port, nuxt_port } )
282277 return
283278 }
284279 } )
0 commit comments