I am currently trying to figure out how can I re-design an incoming url request in node.js and read the parameters from there.I am using restify.
In my router.js :
server.get('/myDomainName/myService/:location/:userId',myFunction);
I am getting the "location" and "userId" as parameter from here and further processing.
This is working perfectly. But I need to redesign the URL like ,
/myDomainName/myService?location={someLocation}&userId={someID}.
So, I have designed the URL like this :
/myDomainName/myService?location=:x&userId=:y
But when I am trying to read the value of x and y (console.log(request.params.x)) , they are undefined. I need to use that x and y value for further processing.
What I am doing wrong here for URL design ? How can I implement this ?
Thanks in advance.