feat: add listen port from env
This commit is contained in:
@ -16,6 +16,7 @@ using Mirea.Api.Endpoint.Middleware;
|
||||
using Mirea.Api.Security.Services;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Mirea.Api.Endpoint;
|
||||
|
||||
@ -66,6 +67,15 @@ public class Program
|
||||
});
|
||||
});
|
||||
|
||||
if (!string.IsNullOrEmpty(builder.Configuration.GetValue<string>("INTERNAL_PORT")))
|
||||
{
|
||||
builder.WebHost.ConfigureKestrel(options =>
|
||||
{
|
||||
options.ListenLocalhost(
|
||||
int.Parse(builder.Configuration.GetValue<string>("INTERNAL_PORT")!));
|
||||
});
|
||||
}
|
||||
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
var secretForward = builder.Configuration.Get<GeneralConfig>();
|
||||
|
Reference in New Issue
Block a user