In this recipe, we will learn how to transform an ASP.NET HTTP handler to ASP.NET Core middleware.
Before anything, let's recap what an HTTP handler is. An HTTP handler handles an incoming request from the ASP.NET/IIS pipeline and generates a response for a given extension file (.aspx, .html, .jpg, and so on.) For ASP.NET MVC, we used a specific handler named MVCHandler, which ensures that an action method exists in a controller for the specified route in the request URL.