2023-01-04 19:36:38 +00:00
|
|
|
using Elsa.Extensions;
|
2023-06-08 10:01:26 +00:00
|
|
|
using Elsa.Samples.AspNet.RunTaskIntegration.Workflows;
|
2023-01-04 19:36:38 +00:00
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
// Add services to the container.
|
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
|
builder.Services.AddHandlersFrom<Program>();
|
|
|
|
|
|
|
|
|
|
builder.Services.AddElsa(elsa =>
|
|
|
|
|
{
|
|
|
|
|
elsa.AddWorkflow<HungryWorkflow>();
|
|
|
|
|
elsa.UseHttp();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
app.MapControllers();
|
|
|
|
|
app.UseWorkflows();
|
|
|
|
|
app.Run();
|