// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAntiforgery antiforgery, IHttpContextAccessor httpContextAccessor) { var locOptions = app.ApplicationServices.GetService <IOptions <RequestLocalizationOptions> >(); app.UseRequestLocalization(locOptions.Value); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { if (Config.Debug) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } } app.UseStaticFiles(FileOptions); SampleProject.Configure(httpContextAccessor, env, Configuration, antiforgery); app.UseSession(); // IMPORTANT: MUST be before UseMvc() app.UseAuthentication(); app.UseCors("CorsPolicy"); app.UseMvc(routes => { routes.MapRoute(name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
static void Main() { using (var game = new SampleProject()) game.Run(); }