diff --git a/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs b/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs index 98c50ab1..ab6d084f 100644 --- a/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs +++ b/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs @@ -20,7 +20,7 @@ public enum ReleaseType public interface IProxyConfiguration { - int ApiPort { get; } + int ApiPort { get; set; } bool AsSystemProxy { get; set; } string ConfigFile { get; } #pragma warning disable CA2227 diff --git a/DevProxy/Commands/DevProxyCommand.cs b/DevProxy/Commands/DevProxyCommand.cs index b581b54a..f2fb0b6f 100644 --- a/DevProxy/Commands/DevProxyCommand.cs +++ b/DevProxy/Commands/DevProxyCommand.cs @@ -17,6 +17,7 @@ sealed class DevProxyCommand : RootCommand private WebApplication? _app; internal const string PortOptionName = "--port"; + internal const string ApiPortOptionName = "--api-port"; internal const string IpAddressOptionName = "--ip-address"; internal const string LogLevelOptionName = "--log-level"; internal const string RecordOptionName = "--record"; @@ -196,6 +197,12 @@ private void ConfigureCommand() HelpName = "port" }; + var apiPortOption = new Option(ApiPortOptionName) + { + Description = "The port for the Dev Proxy API to listen on", + HelpName = "api-port" + }; + var recordOption = new Option(RecordOptionName) { Description = "Use this option to record all request logs" @@ -307,6 +314,7 @@ private void ConfigureCommand() var options = new List