Implemented the ability to configure the default port for non-docker users. Docker users will always be 5000. (#280)
This commit is contained in:
parent
4606b54603
commit
5259a1484a
6 changed files with 63 additions and 7 deletions
|
|
@ -20,13 +20,13 @@ namespace API
|
|||
{
|
||||
public class Program
|
||||
{
|
||||
private static readonly int HttpPort = 5000;
|
||||
private static int HttpPort;
|
||||
|
||||
protected Program()
|
||||
{
|
||||
}
|
||||
|
||||
private static string GetAppSettingFilename()
|
||||
public static string GetAppSettingFilename()
|
||||
{
|
||||
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
var isDevelopment = environment == Environments.Development;
|
||||
|
|
@ -46,6 +46,9 @@ namespace API
|
|||
var base64 = Convert.ToBase64String(rBytes).Replace("/", "");
|
||||
Configuration.UpdateJwtToken(GetAppSettingFilename(), base64);
|
||||
}
|
||||
|
||||
// Get HttpPort from Config
|
||||
HttpPort = Configuration.GetPort(GetAppSettingFilename());
|
||||
|
||||
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue