diff --git a/mocha-dotnet/src/app/Mocha.Oms.Server/Program.cs b/mocha-dotnet/src/app/Mocha.Oms.Server/Program.cs index 4e27e7d..782c3ad 100644 --- a/mocha-dotnet/src/app/Mocha.Oms.Server/Program.cs +++ b/mocha-dotnet/src/app/Mocha.Oms.Server/Program.cs @@ -25,7 +25,20 @@ public class Program : WebApplication public Dictionary _Sessions = new Dictionary(); - protected override int DefaultPort => 4436; + protected override int DefaultPort + { + get + { + if (System.Environment.GetEnvironmentVariable("OMS_SERVERPORT") != null) + { + if (Int32.TryParse(System.Environment.GetEnvironmentVariable("OMS_SERVERPORT"), out int port)) + { + return port; + } + } + return 4436; + } + } public Program() {