Page 1 of 1

change service url on user selection

Posted: Wed Nov 25, 2015 6:29 pm
by A K R

Hi,

i have two different urls one is online and another is offline
i have done the following in setting service
online https://onlineurl
offline http://offlineurl

whenever a user log in he need to choose online or offline by clicking on respective buttons. on click of buttons am storing the url in localstorage. so i need to toggle the url as per the user selection. how can i pass the local storage value in the service url.

so how can i change the url in the service call
waiting for reply. Thanks


change service url on user selection

Posted: Thu Nov 26, 2015 11:06 am
by Serhii Kulibaba

Hello,

Please use Servise's parameter URL={myURL} (http://prntscr.com/974ay7)
And add request parameter myURL (http://prntscr.com/974b9b)

Add mapping arrow from the storage variable into that request parameter. Appery.io automatically will change service's URL into the value of that variable


change service url on user selection

Posted: Fri Nov 27, 2015 3:14 am
by A K R

Hi,
Its working.
Thanks for reply.

i checked my network tab in browser and the appery url is changing according to my localStorage

And the images you have attached it helped me to understand well
Thanks