I've a basic model where I would like to implement an endpoint that is capable to return subset of list back when we pass in some string param, and not sure how to go about doing it.
here is json file:
var user = [
{"id": "1", "name": "subash", "age": "22", "occupation": "doctor"},
{"id": "2", "name": "alex", "ip": "33", "occupation": "engineer"},
{"id": "3", "name": "darran", "ip": "18", "occupation": "singer"}
];
expected endpoint
app.get('/users/:someStringParam', user.findById);
expected response
Filters/returns rows of users who's name has letter 'a'.
I've looked at app.param() method of express framework but not sure how to go about!