I have my optional parameter defined using my function parambelow, but when I try to pass the postman in the optional parameter, I get a Reference Error 'off' is not defined. I cannot figure out how to use the value that I pass for the parameter in the second function below, and I assume that my misuse of this is what causes the error. I am trying to determine my parameter in the first function.
router.param('off', function(req, res, next, off){
req.offset = off;
next();
});
I define my route with an optional parameter here
router.get('/messages/:offset', function(request, res) {
ctxioClient.accounts(ID).messages().get({limit: 100, offset: off},
function ( err, response) {
)};
)};
source
share