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")
|
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
||||||
sOut = oExec.StdOut.ReadAll()
|
sOut = oExec.StdOut.ReadAll()
|
||||||
If Len(Trim(sOut)) > 0 Then
|
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
|
WScript.Quit
|
||||||
End If
|
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
|
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 3000
|
||||||
WScript.Sleep 2500
|
|
||||||
|
|
||||||
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
||||||
sOut = oExec.StdOut.ReadAll()
|
sOut = oExec.StdOut.ReadAll()
|
||||||
If Len(Trim(sOut)) > 0 Then
|
If Len(Trim(sOut)) > 0 Then
|
||||||
MsgBox "AidsMonitoring iniciado correctamente." & vbCrLf & vbCrLf & _
|
oShell.Run "http://localhost:5503", 1, False
|
||||||
"URL: http://localhost:5503" & vbCrLf & _
|
|
||||||
"Tailscale: http://100.96.43.86:5503", 64, "AidsMonitoring"
|
|
||||||
Else
|
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
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user