We need to modify the code contained inside the Configure() method of our Startup class. It is here that we set up middleware in an ASP.NET Core application. In Chapter 10, Exploring .NET Core 1.1, we saw that our Configure() method already contained two pieces of middleware. The first is a piece of middleware that will display a developer exception page when an unhandled exception is caught. The code looks as follows:
if (env.IsDevelopment()){ app.UseDeveloperExceptionPage();}
This will display any error messages which is useful for debugging the application. Typically, this page would contain information such as a stack trace. It is only installed when the application is in development mode. When you first create an ASP.NET ...