How to keep Expose Server alive on Windows #227
Replies: 2 comments
-
Sorry, I don't have any experience in hosting your own Expose server on Windows. |
Beta Was this translation helpful? Give feedback.
-
I was able to modify this Powershell script that creates a Windows Service. I installed Expose within the project and use the Powershell script/service to check if expose is running and start it if it's not. The timer tick looks similar to below. $running = gcim win32_process | where-object {$_.Name -like "*php.exe*"} | select commandline | where-object {$_.commandline -like "*expose*share-port 1433"}
if($running){
Log "$scriptName -Service # Tunnel Is running"
}
else
{
#$installDir = "${ENV:ProgramFiles}\$serviceName"
$cmd = "'$($installDir)\vendor\bin\expose' share-port 1433"
Log "$scriptName -Service # Attempting to restart tunnel"
$cmd = "$($installDir)\vendor\bin\expose"
Start-Process -FilePath $cmd -WorkingDirectory $installDir -ArgumentList "share-port 1433"
$cmd = $null;
}
$running = $null; My project directory looks like this (I renamed the file to
A complete install looks like this:
I'm only using this in scenarios where I have no other option but to run via Windows. Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
I have read the documentation here: https://beyondco.de/docs/expose/server/starting-the-server
How to keep it alive via Mac OS and Linux but there aren't ways to keep it alive on Windows. Normally you could easily do it if Expose was an application or a some sort of file, but since its commands i'm curious of how to do that on windows.
The current documentation works for windows except the part to keep Expose alive just in case the command prompt is exited.
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions