diff options
author | TrueDoctor <d-kobert@web.de> | 2018-09-27 21:02:07 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2018-09-27 21:02:07 +0200 |
commit | 39da0da55a09a56bae3c250e6108c8edf77bfbfd (patch) | |
tree | 05dc756c6e5f65d5a190ce6524c307fe753279e9 /DSACore/Startup.cs | |
parent | 4f535d76f32ef369abe37560594ef1a702e47d64 (diff) |
fixed some stuff
Diffstat (limited to 'DSACore/Startup.cs')
-rw-r--r-- | DSACore/Startup.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs index 2d0c2a3..0628151 100644 --- a/DSACore/Startup.cs +++ b/DSACore/Startup.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; +using DSACore.Hubs; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -25,7 +26,15 @@ 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("AllowSpecificOrigin", + builder => builder.WithOrigins("https://console.firebase.google.com/project/heldenonline-4d828")); + }); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + + services.AddSignalR(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -40,6 +49,8 @@ namespace DSACore app.UseHsts(); } + app.UseSignalR(routes => { routes.MapHub<ChatHub>("/chatHub"); }); + app.UseCors("AllowSpecificOrigin"); app.UseHttpsRedirection(); app.UseMvc(); } |