summaryrefslogtreecommitdiff
path: root/DSACore/Startup.cs
diff options
context:
space:
mode:
authorTrueKuehli <rctcoaster2000@hotmail.de>2018-09-29 17:19:43 +0200
committerTrueKuehli <rctcoaster2000@hotmail.de>2018-09-29 17:19:43 +0200
commitb83fc90abacc73262e0f8404cebadf6d64eb10ae (patch)
treed63b921c9bcdf8d381fc02ecfb0a1dd425ebb561 /DSACore/Startup.cs
parent586d564f3c4c509c1aae931331e96f0382178f80 (diff)
parent680967aee589e4a8d277044b204de07cbe32f41e (diff)
Merge branch 'WebApi' of https://github.com/TrueDoctor/DiscoBot into WebApi
Merged the stuffs
Diffstat (limited to 'DSACore/Startup.cs')
-rw-r--r--DSACore/Startup.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs
index 0628151..c189436 100644
--- a/DSACore/Startup.cs
+++ b/DSACore/Startup.cs
@@ -26,12 +26,23 @@ namespace DSACore
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
+ services.AddCors(options => options.AddPolicy("CorsPolicy",
+ builder =>
+ {
+ builder.WithOrigins("https://dsa.truekuehli.de")
+ .WithHeaders("Access-Control-Allow-Origin")
+ .AllowAnyHeader()
+ .AllowAnyMethod()
+ .AllowCredentials();
+ }));
+ /*
services.AddCors(options =>
{
options.AddPolicy("AllowSpecificOrigin",
- builder => builder.WithOrigins("https://console.firebase.google.com/project/heldenonline-4d828"));
+ builder => builder.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin().AllowCredentials()/*WithOrigins("https://dsa.truekuehli.de")#1#);
});
+*/
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddSignalR();
@@ -49,9 +60,13 @@ namespace DSACore
app.UseHsts();
}
+ app.UseCors("CorsPolicy");
+
app.UseSignalR(routes => { routes.MapHub<ChatHub>("/chatHub"); });
- app.UseCors("AllowSpecificOrigin");
- app.UseHttpsRedirection();
+
+
+ //app.UseCors("AllowSpecificOrigin");
+ //app.UseHttpsRedirection();
app.UseMvc();
}
}