diff options
| -rw-r--r-- | src/DevHive.Web/Startup.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/DevHive.Web/Startup.cs b/src/DevHive.Web/Startup.cs index 42fc88a..96ab318 100644 --- a/src/DevHive.Web/Startup.cs +++ b/src/DevHive.Web/Startup.cs @@ -20,6 +20,8 @@ namespace DevHive.Web // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
+ services.AddCors();
+
services.AddControllers()
.AddNewtonsoftJson(x =>
{
@@ -36,6 +38,12 @@ namespace DevHive.Web // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
+ app.UseCors(x => x
+ .AllowAnyMethod()
+ .AllowAnyHeader()
+ .SetIsOriginAllowed(origin => true) // allow any origin
+ .AllowCredentials()); // allow credentials
+
if (env.IsDevelopment())
{
//app.UseDeveloperExceptionPage();
|
