If your are using
express above 2.x, you have to declare
app.router like below code. Please try to replace your code
Please click here to get more details about app.router
app.router is depreciated in
express 3.0+. If you are using express 3.0+, refer to Anirudh’s answer below.