diff options
author | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-27 21:04:16 +0200 |
---|---|---|
committer | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-27 21:04:16 +0200 |
commit | 5a317ff78acfd18ca586b763817e0810d030ca08 (patch) | |
tree | 1a1a96cd68d001c17fdc14034a50090461da335e /DSACore/Startup.cs | |
parent | 3fa656c782c9235e354f1d7e53f40865ea482eaa (diff) | |
parent | 39da0da55a09a56bae3c250e6108c8edf77bfbfd (diff) |
Merge branch 'WebApi' of https://github.com/TrueDoctor/DiscoBot into WebApi
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(); } |