fix app.match method not found problem

seems the code is out of date that req.app does not have a method named "match", so I updated the code with the correct routines.