Skip to content

Commit ff03361

Browse files
committed
Bind Elsa HTTP options to shell configuration and update appsettings to support multi-environment base paths and URLs.
1 parent ddf1d35 commit ff03361

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/apps/OrchardCore.Elsa.Web/appsettings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,23 @@
4747
"RefreshTokenLifetime": "1:00:10:00"
4848
}
4949
}
50+
},
51+
"OrchardCore": {
52+
"Default": {
53+
"Elsa": {
54+
"Http": {
55+
"BasePath": "/wf",
56+
"BaseUrl": "https://localhost:8096"
57+
}
58+
}
59+
},
60+
"Acme": {
61+
"Elsa": {
62+
"Http": {
63+
"BasePath": "/wf",
64+
"BaseUrl": "https://localhost:8096/acme"
65+
}
66+
}
67+
}
5068
}
5169
}

src/modules/OrchardCore.Elsa/Features/CoreStartup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public override void ConfigureServices(IServiceCollection services)
9595

9696
provider.Mappings[".pdb"] = "application/octet-stream";
9797
provider.Mappings[".wasm"] = "application/wasm";
98-
provider.Mappings[".dat"] = "application/octet-stream"; // you already had this
98+
provider.Mappings[".dat"] = "application/octet-stream";
9999

100100
options.ContentTypeProvider = provider;
101101
});

src/modules/OrchardCore.Elsa/Features/HttpStartup.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
using Elsa.Extensions;
22
using Microsoft.AspNetCore.Builder;
33
using Microsoft.AspNetCore.Routing;
4+
using Microsoft.Extensions.Configuration;
45
using Microsoft.Extensions.DependencyInjection;
6+
using OrchardCore.Environment.Shell.Configuration;
57
using OrchardCore.Modules;
68

79
namespace OrchardCore.Elsa.Features;
810

911
[Feature("OrchardCore.Elsa.Http")]
10-
public class HttpStartup : StartupBase
12+
public class HttpStartup(IShellConfiguration shellConfiguration) : StartupBase
1113
{
1214
public override void ConfigureServices(IServiceCollection services)
1315
{
@@ -17,8 +19,7 @@ public override void ConfigureServices(IServiceCollection services)
1719
{
1820
http.ConfigureHttpOptions = options =>
1921
{
20-
options.BasePath = "/wf";
21-
options.BaseUrl = new("https://localhost:8096");
22+
shellConfiguration.GetSection("Elsa:Http").Bind(options);
2223
};
2324
http.UseCache();
2425
});

src/modules/OrchardCore.Elsa/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"Shell": {
1010
"DisableAuthorization": false
1111
}
12-
}
12+
}

0 commit comments

Comments
 (0)