@@ -64,6 +64,7 @@ var localServerStartCmd = &console.Command{
6464 project .ConfigurationFlags ,
6565 dirFlag ,
6666 & console.BoolFlag {Name : "no-humanize" , Usage : "Do not format JSON logs" },
67+ & console.BoolFlag {Name : "open" , Usage : "Open the application in the browser after starting the server" },
6768 ),
6869 Action : func (c * console.Context ) error {
6970 ui := terminal .SymfonyStyle (terminal .Stdout , terminal .Stdin )
@@ -274,11 +275,21 @@ var localServerStartCmd = &console.Command{
274275 if p .PHPServer != nil {
275276 msg += fmt .Sprintf (" The Web server is using %s %s\n " , p .PHPServer .Version .ServerTypeName (), p .PHPServer .Version .Version )
276277 }
277- msg += fmt .Sprintf ("\n <href=%s://127.0.0.1:%d>%s://127.0.0.1:%d</>" , scheme , port , scheme , port )
278+ applicationUrl := fmt .Sprintf ("%s://127.0.0.1:%d" , scheme , port )
279+ msg += fmt .Sprintf ("\n <href=%s>%s</>" , applicationUrl , applicationUrl )
278280 if proxyConf , err := proxy .Load (homeDir ); err == nil {
279281 for _ , domain := range proxyConf .GetDomains (projectDir ) {
280282 msg += fmt .Sprintf ("\n <href=%s://%s>%s://%s</>" , scheme , domain , scheme , domain )
281283 }
284+
285+ domains := proxyConf .GetReachableDomains (projectDir )
286+ if len (domains ) > 0 {
287+ applicationUrl = fmt .Sprintf ("%s://%s" , scheme , domains [0 ])
288+ }
289+ }
290+
291+ if c .Bool ("open" ) {
292+ abstractOpenCmd (applicationUrl )
282293 }
283294
284295 select {
0 commit comments