public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
var angularRoutes = new[] {
"/home",
"/forbidden",
"/authorized",
"/authorize",
"/unauthorized",
"/dataeventrecords",
"/dataeventrecords/create",
"/dataeventrecords/edit",
"/logoff",
"/securefile",
"/securefile/securefiles",
};
app.Use(async (context, next) =>
{
if (context.Request.Path.HasValue && null != angularRoutes.FirstOrDefault(
(ar) => context.Request.Path.Value.StartsWith(ar, StringComparison.OrdinalIgnoreCase)))
{
context.Request.Path = new PathString("/");
}
await next();
});
app.UseDefaultFiles();
app.UseStaticFiles();
app.Run(async (context) =>
{
await context.Response.WriteAsync("This is server routing, not angular2 routing");
});
}