concept main.js app.get("/items/:vegetable in category node

appears as: main.js app.get("/items/:vegetable
Get Programming with Node.js

This is an excerpt from Manning's book Get Programming with Node.js.

  • Back in main.js, change the route to look like the next listing. When a request is made to this path, the function assigned to sendReqParam in the home controller is run.
    Listing 9.7. Replacing a callback with a controller function in main.js
    app.get("/items/:vegetable", homeController.sendReqParam);     1
    • 1 Handle GET requests to “/items/:vegetable”.
  • Listing 9.7. Replacing a callback with a controller function in main.js
    app.get("/items/:vegetable", homeController.sendReqParam);     1