Custom JSON directory listing middleware