Implement App embedding as middleware