Reputation: 730
I need to find how many parameters sent in an URL.
How can I determine the number of parameters sent via URL in nodeJS?
Upvotes: 0
Views: 50
Reputation: 5192
use req.query
if Your URL is like localhost:3000?param1=¶m2=
var params = req.query;
van length = Object.keys(params).length;
the length is 2.
Upvotes: 1