Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified B2C Commerce Developer (Comm-Dev-101) Exam - Topic 2 Question 102 Discussion

Server.get('Show', consentTracking.consent, cache.applyDefaultCache, function (req,res,next){Var Site = require('dw/system/Syte'');Var pageMetaHelpter = require('*/cartridge/scripts/helpers/pageMetaHelper');pageMetaHelpter.setPageMetaTags(req.pageMetaData, Site.current);res.render('/home/homePage');Missing code here}, pageMetadata.computedPageMetadata);The controller endpoint code snippet above does not work.Which line of code should the developer use to replace line 6 and correct the problem?
A) next();
B) return res;C. res.next();
D) req.next();

Salesforce Certified B2C Commerce Developer (Comm-Dev-101) Exam - Topic 2 Question 102 Discussion

Actual exam question for Salesforce's Salesforce Certified B2C Commerce Developer (Comm-Dev-101) exam
Question #: 102
Topic #: 2
[All Salesforce Certified B2C Commerce Developer (Comm-Dev-101) Questions]

Server.get('Show', consentTracking.consent, cache.applyDefaultCache, function (req,res,next){

Var Site = require('dw/system/Syte'');

Var pageMetaHelpter = require('*/cartridge/scripts/helpers/pageMetaHelper');

pageMetaHelpter.setPageMetaTags(req.pageMetaData, Site.current);

res.render('/home/homePage');

Missing code here

}, pageMetadata.computedPageMetadata);

The controller endpoint code snippet above does not work.

Which line of code should the developer use to replace line 6 and correct the problem?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Arletta
1 month ago
B) return res; could also work, but not ideal here.
upvoted 0 times
...
Toshia
2 months ago
Agreed, it makes sense to call next() for middleware.
upvoted 0 times
...
Robt
2 months ago
I think it should be A) next();
upvoted 0 times
...
Martina
2 months ago
I'm pretty sure A is the right choice!
upvoted 0 times
...
Shaquana
2 months ago
Wait, is D) req.next() even a thing?
upvoted 0 times
...
Shanda
2 months ago
C. res.next() sounds wrong too.
upvoted 0 times
...
Marti
4 months ago
Definitely not B) return res;
upvoted 0 times
...
Kris
4 months ago
I think it should be A) next();
upvoted 0 times
...
Marti
5 months ago
I’m confused about the options. I don’t recall seeing req.next() in practice, so I’m leaning towards A) next() as well, but I’m not completely confident.
upvoted 0 times
...
Glendora
5 months ago
I feel like I've seen something like this before, and I thought it was always about calling next() to continue the flow. So A) next(); seems likely.
upvoted 0 times
...
Nelida
5 months ago
I'm not entirely sure, but I remember something about using return statements in similar questions. Maybe B) return res; could be correct?
upvoted 0 times
...
Lilli
5 months ago
I think the answer might be A) next(); since it seems like we need to pass control to the next middleware.
upvoted 0 times
...

Save Cancel