Add a CORS policy to MicronetesHost to allow discover backend service endpoints from a web frontend like a blazor webassembly or any javascript single page application.
In Blorc.Core we have a configuration service that read values from configuration files that could be hosted in the web server.
micronetes.development.json
{
"Url": "http://127.0.0.1:8001"
}
We can specify the environment file with a parameter in the Url. In this case http://localhost:5005?env=development
So, the Program entry point could look like this:
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddBlorcCore();
if (await builder.IsMicronetesConfigurationAvailable())
{
builder.Services.AddSingleton<IServiceDiscovery, MicronetesServiceDiscovery>();
}
where could be possible use an implementation of IServiceDiscovery for Micronetes, to help connect client side with server side when the APIs are hosted in Micronetes. The MicronetesServiceDiscovery is a work in progress and should be available soon as part of Blorc.Core (or as isolate package).
I use this approach for apps hosted in DCOS (Marathon) with a MarathonServiceDiscovery. But now is possible deploy and debug distributed service locally with Micronetes, so query the available endpoints from the client apps for development purpose could be a good idea.
Add a CORS policy to MicronetesHost to allow discover backend service endpoints from a web frontend like a blazor webassembly or any javascript single page application.
In Blorc.Core we have a configuration service that read values from configuration files that could be hosted in the web server.
micronetes.development.json
We can specify the environment file with a parameter in the Url. In this case
http://localhost:5005?env=development
So, the Program entry point could look like this:
where could be possible use an implementation of IServiceDiscovery for Micronetes, to help connect client side with server side when the APIs are hosted in Micronetes. The MicronetesServiceDiscovery is a work in progress and should be available soon as part of Blorc.Core (or as isolate package).
I use this approach for apps hosted in DCOS (Marathon) with a MarathonServiceDiscovery. But now is possible deploy and debug distributed service locally with Micronetes, so query the available endpoints from the client apps for development purpose could be a good idea.