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 ;
2020-11-14 14:44:03 +00:00
using ElsaDashboard.WebAssembly.Extensions ;
2020-10-26 20:46:43 +00:00
2020-12-27 10:53:52 +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 ) ;
2020-11-13 21:37:53 +00:00
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"));
2020-11-14 14:44:03 +00:00
services . AddElsaDashboardBackend ( ) ;
2020-10-26 20:46:43 +00:00
await builder . Build ( ) . RunAsync ( ) ;
}
}
2020-11-13 21:37:53 +00:00
}