[http] [view] [refactor] Moved view middleware code into view resource.