2021-03-30 13:18:48 +00:00
|
|
|
using System.Net;
|
|
|
|
|
using Elsa.Server.Orleans.Grains.Contracts;
|
2019-11-22 22:07:31 +00:00
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
2021-03-30 13:18:48 +00:00
|
|
|
using Orleans;
|
|
|
|
|
using Orleans.Configuration;
|
|
|
|
|
using Orleans.Hosting;
|
2019-11-22 22:07:31 +00:00
|
|
|
|
2020-12-27 10:53:52 +00:00
|
|
|
namespace Elsa.Samples.Server.Host
|
2019-11-22 22:07:31 +00:00
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
CreateHostBuilder(args).Build().Run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
|
|
|
Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
|
2021-03-30 13:18:48 +00:00
|
|
|
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>())
|
|
|
|
|
.UseOrleans(siloBuilder => siloBuilder
|
|
|
|
|
.UseLocalhostClustering()
|
|
|
|
|
.Configure<ClusterOptions>(options =>
|
|
|
|
|
{
|
|
|
|
|
options.ClusterId = "localhost";
|
|
|
|
|
options.ServiceId = "elsa-workflows";
|
|
|
|
|
})
|
|
|
|
|
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(IWorkflowDefinitionGrain).Assembly).WithReferences())
|
|
|
|
|
.Configure<EndpointOptions>(options => options.AdvertisedIPAddress = IPAddress.Loopback));
|
2019-11-22 22:07:31 +00:00
|
|
|
}
|
|
|
|
|
}
|