We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c300a7 commit 8f75a86Copy full SHA for 8f75a86
LearningHub.Nhs.WebUI/Program.cs
@@ -35,6 +35,19 @@
35
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
36
builder.Host.UseNLog();
37
38
+ string corsMoodleUrl = builder.Configuration.GetValue<string>("MoodleAPIConfig:BaseUrl");
39
+
40
+ builder.Services.AddCors(options =>
41
+ {
42
+ options.AddPolicy("MoodleCORS", builder =>
43
44
+ builder.WithOrigins(corsMoodleUrl)
45
+ .AllowAnyHeader()
46
+ .AllowAnyMethod()
47
+ .AllowCredentials();
48
+ });
49
50
51
builder.Services.AddHostedService<TimedHostedService>();
52
builder.Services.ConfigureServices(builder.Configuration, builder.Environment);
53
@@ -78,6 +91,8 @@
78
91
app.UseHttpsRedirection();
79
92
}
80
93
94
+ app.UseCors("MoodleCORS");
95
81
96
app.UseRouting();
82
97
83
98
app.UseAuthentication();
0 commit comments