Question: Assuming using Node.js , Express and EJS template engine to handle requests for an application with the domain name example.com. If the server had the

Assuming using Node.js, Express and EJS template engine to handle requests for an application with the domain name example.com.
If the server had the following route and request handler for a GET request
app.get('/item/:itemID', function (request, response){
response.sendFile('/views/'+ request.params.itemID +'.html');
});
What will be the result (response) to a request a client sends by typing the URL example.com/item/12345 into their browser?
Group of answer choices
the browser will display the 'request.params.itemID.html' file located in the 'views' subdirectory
the browser will display the '12345.html' file located in the 'views' subdirectory
there will be no response received since the client sent a POST request and only a GET request handler is defined
the browser will display the 'itemID.html' file located in the 'views' subdirectory

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!