We know CreateHostBuilder()
is important because it’s responsible for certain configuration settings for our application, but now, let’s take some time to dive into the UseStartup()
method, which gets called to build our middleware pipeline.
Inside of the Startup
class is a Configure()
method. The Configure()
method calls various app.UseX()
methods to build the middleware pipeline. Each app.UseX()
method corresponds to a different component and the methods are typically named based on the action they perform. For example, app.UseAuthorization()
adds an authorization middleware component to the application.
A key aspect to remember about the Configure()
method is that the order in which the app.UseX()
methods are called determines the order in which the components appear in the pipeline.
Instructions
The UseWelcomePage
middleware component displays a default welcome page. Let’s add it to the pipeline.
Within the Configure()
method, right after the line app.UseAuthorization()
, add the line app.UseWelcomePage()
.