freeCodeCamp/guide/english/certifications/apis-and-microservices/basic-node-and-express/get-query-parameter-input-f.../index.md

772 B

title
Get Query Parameter Input from the Client

Get Query Parameter Input from the Client

Given the hint after the stub, "/name?first=&last=," we can build the response like so:

 app.get("/name", function(req, res) {
   var firstName = req.query.first;
   var lastName = req.query.last;
   // Send the json object
 });

Help our community expand these hints and guides.