Skip to content

Instantly share code, notes, and snippets.

@ngohungphuc
Created May 1, 2019 13:37
Show Gist options
  • Select an option

  • Save ngohungphuc/78a4ef235ec331c2ff6df03c241e6450 to your computer and use it in GitHub Desktop.

Select an option

Save ngohungphuc/78a4ef235ec331c2ff6df03c241e6450 to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
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.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseSignalR(routes =>
{
routes.MapHub<ConnectionHub>("/connectionHub");
});
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment