Auto-open browser after server start
This commit is contained in:
+4
-8
@@ -12,21 +12,17 @@ Dim oExec, sOut
|
||||
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
||||
sOut = oExec.StdOut.ReadAll()
|
||||
If Len(Trim(sOut)) > 0 Then
|
||||
MsgBox "AidsMonitoring ya esta corriendo en el puerto 5503.", 64, "AidsMonitoring"
|
||||
oShell.Run "http://localhost:5503", 1, False
|
||||
WScript.Quit
|
||||
End If
|
||||
|
||||
' Uvicorn via pythonw — redirige stdout/stderr al log
|
||||
oShell.Run "cmd /c cd /d """ & sBackend & """ && """ & sPython & """ -m uvicorn main:app --host 0.0.0.0 --port 5503 >> """ & sLog & """ 2>&1", 0, False
|
||||
|
||||
WScript.Sleep 2500
|
||||
WScript.Sleep 3000
|
||||
|
||||
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
||||
sOut = oExec.StdOut.ReadAll()
|
||||
If Len(Trim(sOut)) > 0 Then
|
||||
MsgBox "AidsMonitoring iniciado correctamente." & vbCrLf & vbCrLf & _
|
||||
"URL: http://localhost:5503" & vbCrLf & _
|
||||
"Tailscale: http://100.96.43.86:5503", 64, "AidsMonitoring"
|
||||
oShell.Run "http://localhost:5503", 1, False
|
||||
Else
|
||||
MsgBox "El servidor tardo en iniciar. Revisa logs\server.log si hay errores.", 48, "AidsMonitoring"
|
||||
MsgBox "El servidor no respondio. Revisa logs\server.log", 48, "AidsMonitoring"
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user