elsa-core/src/samples/dashboard/ElsaDashboard.Samples.WebAssembly/Program.cs

31 lines
1.4 KiB
C#
Raw Normal View History

2020-10-26 20:46:43 +00:00
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;
2021-03-18 11:18:22 +00:00
using ElsaDashboard.Application;
using ElsaDashboard.WebAssembly.Extensions;
2020-10-26 20:46:43 +00:00
namespace ElsaDashboard.Samples.WebAssembly
2020-10-26 20:46:43 +00:00
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
var services = builder.Services;
2021-03-18 11:18:22 +00:00
builder.RootComponents.Add<App>("#app");
// Change the Elsa Server URL to point to wherever you have hosted Elsa. In this example, Elsa is either hosted by "ElsaDashboard.Samples.Monolith" or "Elsa.Samples.Server.Host"
services.AddElsaDashboardUI(options => options.ElsaServerUrl = new Uri("https://localhost:11000"));
// When the web assembly project is hosted directly from e.g. blob storage, the URL to the gRPC backend needs to be specified explicitly.
// When hosted from ElsaDashboard.Samples.Monolith or ElsaDashboard.Samples.Server, we don't need to specify a backend URL.
//services.AddElsaDashboardBackend(options => options.BackendUrl = new Uri("https://localhost:11000"));
services.AddElsaDashboardBackend();
2020-10-26 20:46:43 +00:00
await builder.Build().RunAsync();
}
}
}