Is it possible to only accept certain parameter types (in this case digits)? If a letter or other character is entered I want to revert to a default scenario.
The noted code are the two attempts I've made.
app.get('/multi/:num?', function (request, response) {
//if (num.match("[A-Za-z]"))
// { num = 4}
//if (num in (/\D/))
//{ num = 4}
var num = (request.params.num || 4);
}
response.send(num);