A K R
Posts: 0
Joined: Mon Sep 22, 2014 6:06 am

change service url on user selection

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

change service url on user selection

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

A K R
Posts: 0
Joined: Mon Sep 22, 2014 6:06 am

change service url on user selection

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

Return to “Issues”