Middleware for feature toggling views