Use the port provided by args or default 5000 for dev

This commit is contained in:
Thorsten Sommer 2024-05-11 13:30:17 +02:00
parent 58f8875015
commit f15c6b4878
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -10,7 +10,7 @@ using Microsoft.Extensions.FileProviders;
using MudBlazor;
using MudBlazor.Services;
var builder = WebApplication.CreateBuilder(args);
var builder = WebApplication.CreateBuilder();
builder.Services.AddMudServices(config =>
{
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomLeft;
@ -35,7 +35,8 @@ builder.Services.AddRazorComponents()
x.MaximumReceiveMessageSize = null;
});
builder.WebHost.UseUrls("http://localhost:5000");
var port = args.Length > 0 ? args[0] : "5000";
builder.WebHost.UseUrls($"http://localhost:{port}");
var fileProvider = new ManifestEmbeddedFileProvider(Assembly.GetAssembly(type: typeof(Program))!, "wwwroot");
var app = builder.Build();