diff options
Diffstat (limited to 'DSACore/Startup.cs')
-rw-r--r-- | DSACore/Startup.cs | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs index f8f6dfd..ef22802 100644 --- a/DSACore/Startup.cs +++ b/DSACore/Startup.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using DSACore.Hubs; 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; -using Microsoft.Extensions.Options; namespace DSACore { @@ -26,23 +19,7 @@ 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.AllowAnyOrigin()//.WithOrigins("https://dsa.truekuehli.de", "127.0.0.1") - .WithHeaders("Access-Control-Allow-Origin") - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials(); - })); - /* - services.AddCors(options => - { - options.AddPolicy("AllowSpecificOrigin", - builder => builder.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin().AllowCredentials()/*WithOrigins("https://dsa.truekuehli.de")#1#); - }); - -*/ + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSignalR(); @@ -52,23 +29,19 @@ namespace DSACore public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) - { app.UseDeveloperExceptionPage(); - } else - { app.UseHsts(); - } app.UseCors("CorsPolicy"); - app.UseSignalR(routes => { routes.MapHub<ChatHub>("/chatHub"); }); + app.UseSignalR(routes => { routes.MapHub<Users>("/login"); }); app.UseWebSockets(); - - //app.UseCors("AllowSpecificOrigin"); + + //app.UseCors("AllowSpecificOrigin"); app.UseHttpsRedirection(); app.UseMvc(); } } -} +}
\ No newline at end of file |