path trim() the tail /, parse req.query if necessary