Cannot find the Elsa REST APIs #7110
Unanswered
tirtha2025
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have created a .Net Core 8 web application. My Program.cs and launch settings looks like this:
Program.cs
using colid_workflow_services.Workflows;
using Elsa.Extensions;
using Elsa.EntityFrameworkCore.Extensions;
using Elsa.EntityFrameworkCore.Modules.Management;
using Elsa.EntityFrameworkCore.Modules.Runtime;
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddElsa(elsa =>
{
elsa.AddWorkflow();
elsa.UseHttp(http => http.ConfigureHttpOptions = options =>
{
options.BaseUrl = new Uri("https://localhost:5001");
options.BasePath = "/workflows";
});
elsa.UseWorkflowManagement(management => management.UseEntityFrameworkCore(ef => ef.UseMySql("Server=localhost;Port=3306;Database=elsa;User=dbuser;Password=dbpass;")));
elsa.UseWorkflowRuntime(runtime => runtime.UseEntityFrameworkCore(ef => ef.UseMySql("Server=localhost;Port=3306;Database=elsa;User=dbuser;Password=dbpass;")));
elsa.UseWorkflowsApi();
});
//builder.Services.AddElsa(options => options.UseEntityFrameworkPersistence(ef => ef.UseMySql("Server=localhost;Port=3306;Database=elsa;User=myuser;Password=mypassword;")));
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
var app = builder.Build();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.UseWorkflowsApi();
app.UseWorkflows();
app.Run();
//////////////////////////////////
launchsettings.json
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38334",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5284",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7291;http://localhost:5284",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
I also have a helloworld.cs file to create a simple getuser workflow.
On running the application I can execute the users workflow using GET http://localhost:38334/workflows/users/2
But i cannot see/use the REST Api http://localhost:38334/elsa/api/v1/workflow-registry
What configuration am i missing?
Beta Was this translation helpful? Give feedback.
All reactions