fsbolero / Bolero

Bolero brings Blazor to F# developers with an easy to use Model-View-Update architecture, HTML combinators, hot reloaded templates, type-safe endpoints, advanced routing and remoting capabilities, and more.
https://fsbolero.io
Apache License 2.0
1.06k stars 53 forks source link

Bolero ignores ASPNETCORE_HTTP_PORTS environment variable #352

Open MichaelMay81 opened 4 months ago

MichaelMay81 commented 4 months ago

I want to deploy Bolero in the aspnet docker image from Microsoft. This needs the app to listen on port 8080. The image enforces this with the env variable ASPNETCORE_HTTP_PORTS. But Bolero seems to ignore this.

Anyone know how do I get this env variable to work? Or a workaround?

MichaelMay81 commented 4 months ago

One way to activate this, was to add it by hand:

match System.Environment.GetEnvironmentVariable "ASPNETCORE_HTTP_PORTS" with | null -> () | port -> webHost.UseUrls $"http://localhost:{port}" |> ignore

Tarmil commented 4 months ago

Hmm, normally this should work. The Bolero project template uses WebApplication.CreateBuilder, just like standard ASP.NET Core templates, and not the older WebHost.CreateDefaultBuilder that the documentation says doesn't support ASPNETCORE_HTTP_PORTS.

Bananas-Are-Yellow commented 2 months ago

I just tried the latest template (version 0.23.19) and it seems to use the older WebHost.CreateDefaultBuilder.

According to dotnet new update --check-only, version 0.23.19 is the latest project template, but I can see newer versions here:

https://github.com/fsbolero/Template/releases

How do I get these newer versions?