Add page middleware.