Created
June 26, 2018 16:13
-
-
Save gsedubun/a431fb8864fdecfff43282d9b6a3ca45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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