fix: add BackendPort configuration to support dynamic backend port setting
Some checks failed
Build and Deploy to Production / deploy (push) Has been cancelled
Some checks failed
Build and Deploy to Production / deploy (push) Has been cancelled
This commit is contained in:
@@ -59,7 +59,8 @@ jobs:
|
|||||||
"FromEmail": "${{ vars.SMTP_FROM_EMAIL }}",
|
"FromEmail": "${{ vars.SMTP_FROM_EMAIL }}",
|
||||||
"ReceivingEmail": "${{ vars.YOUR_RECEIVING_EMAIL }}"
|
"ReceivingEmail": "${{ vars.YOUR_RECEIVING_EMAIL }}"
|
||||||
},
|
},
|
||||||
"CorsOrigins": "${{ vars.FRONTEND_URL }}"
|
"CorsOrigins": "${{ vars.FRONTEND_URL }}",
|
||||||
|
"BackendPort": "${{ vars.BACKEND_PORT }}"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using System.Net;
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
if (builder.Configuration["BACKEND_PORT"] is { Length: > 0 } port && ushort.TryParse(port, out _))
|
if (builder.Configuration["BackendPort"] is { Length: > 0 } port && ushort.TryParse(port, out _))
|
||||||
{
|
{
|
||||||
builder.WebHost.UseUrls($"http://0.0.0.0:{port}");
|
builder.WebHost.UseUrls($"http://0.0.0.0:{port}");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user