From 9edff6229e9d0f6ed24d17240bbd42553489249c Mon Sep 17 00:00:00 2001 From: dangershony Date: Mon, 5 Aug 2024 10:41:03 +0100 Subject: [PATCH] Allow cores on the server --- package.json | 2 +- src/Angor/Server/Program.cs | 12 ++++++++++++ src/Directory.Build.props | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5403eadb..2e1c898b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angor", - "version": "0.0.57", + "version": "0.0.58", "license": "MIT", "scripts": { "version": "node -p \"require('./package.json').version\"", diff --git a/src/Angor/Server/Program.cs b/src/Angor/Server/Program.cs index 6632dbf8..6443677c 100644 --- a/src/Angor/Server/Program.cs +++ b/src/Angor/Server/Program.cs @@ -39,6 +39,16 @@ builder.Services.AddSingleton(); builder.Services.AddSingleton(); //TODO change this from a test class when the flow is complete + +// Add CORS services +builder.Services.AddCors(options => +{ + options.AddPolicy("AllowSpecificOrigin", + builder => builder.WithOrigins("https://test.angor.io") + .AllowAnyHeader() + .AllowAnyMethod()); +}); + var app = builder.Build(); // Configure the HTTP request pipeline. @@ -61,6 +71,8 @@ app.UseRouting(); +// Use the CORS policy +app.UseCors("AllowSpecificOrigin"); app.MapRazorPages(); app.MapControllers(); diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 90ed6af1..41e9325b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - 0.0.57 + 0.0.58 net7.0 Blockcore MIT