Learn
In conclusion, the middleware pipeline is a system designed to handle each HTTP request, route it to the appropriate destination, and return the correct response. Understanding the functionality of each component is vital to creating a customized pipeline which accurately reflects our desired processing chain. Here are the components we covered in this lesson:
UseDeveloperExceptionPage()
provides an exception page specifically designed for developersUseExceptionHandler()
logs and catches errors and routes users to a general error pageUseHttpsRedirection()
redirects HTTP requests to the more secure HTTPS protocolUseStaticFiles()
allows static files, like CSS and images, to be servedUseRouting()
allows route matchingUseAuthorization()
ensures requests are authorized.UseEndpoints()
adds endpoint execution to the middleware pipeline. It runs the code associated with the selected endpoint.
Hopefully, this lesson has provided you with enough information to be able to customize and configure your own middleware pipeline. Happy configuring!
View ASP.NET middleware documentation to see examples and a full-list of available built-in middleware components.
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.