Update connect middleware
Use req.path to get pathname.
Support rewriting versioned request.