Skip to content

Commit 7195075

Browse files
committed
Add missing CORS headers for public frontend locally
Signed-off-by: Nicholas Tsim <nicholastsim@gmail.com>
1 parent 704d925 commit 7195075

File tree

1 file changed

+12
-0
lines changed
  • src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api

1 file changed

+12
-0
lines changed

src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Startup.cs

+12
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,25 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
221221
app.UseResponseCaching();
222222
app.UseResponseCompression();
223223

224+
// CORS
225+
226+
app.UseCors(options => options
227+
.WithOrigins(
228+
"http://localhost:3000",
229+
"http://localhost:3001",
230+
"https://localhost:3000",
231+
"https://localhost:3001")
232+
.AllowAnyMethod()
233+
.AllowAnyHeader());
234+
224235
// Routing / endpoints
225236

226237
app.UseRouting();
227238
app.UseEndpoints(builder =>
228239
{
229240
builder.MapControllers();
230241
});
242+
231243
app.UseHealthChecks("/api/health");
232244
}
233245

0 commit comments

Comments
 (0)