diff options
author | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:33:41 +0200 |
---|---|---|
committer | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:33:41 +0200 |
commit | af74efccf8d21e6151022b71f3cacd3fa83024ee (patch) | |
tree | 20f383065d5cadea36e8d11d4bb3b35eca99f691 /DSACore/Startup.cs | |
parent | e6181c24124d97f2fbc932b8a68311e625463156 (diff) |
Seperate the Core from dsa gamelogic
Diffstat (limited to 'DSACore/Startup.cs')
-rw-r--r-- | DSACore/Startup.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs new file mode 100644 index 0000000..ef22802 --- /dev/null +++ b/DSACore/Startup.cs @@ -0,0 +1,47 @@ +using DSACore.Hubs; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace DSACore +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + + 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. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + app.UseDeveloperExceptionPage(); + else + app.UseHsts(); + + app.UseCors("CorsPolicy"); + + app.UseSignalR(routes => { routes.MapHub<Users>("/login"); }); + + app.UseWebSockets(); + + //app.UseCors("AllowSpecificOrigin"); + app.UseHttpsRedirection(); + app.UseMvc(); + } + } +}
\ No newline at end of file |