Is it possible to restrict parameter types to only accept digits? If a letter or other character is inputted, I want to fallback to a default scenario.
Below 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);