Skip to content

Instantly share code, notes, and snippets.

@gsedubun
Created June 26, 2018 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsedubun/a431fb8864fdecfff43282d9b6a3ca45 to your computer and use it in GitHub Desktop.
Save gsedubun/a431fb8864fdecfff43282d9b6a3ca45 to your computer and use it in GitHub Desktop.
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
///
/// sesuai bawaan template project
///
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, d =>
{
d.LoginPath = "/account/login";
d.AccessDeniedPath = "/account/denied";
d.Cookie.Name = "chant_signalr";
});
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)
{
///
/// default bawaan template project
///
app.UseAuthentication();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
app.UseSignalR(d=>{
d.MapHub<ChatHub>("/hubs/chat");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment