Page 1 of 1

Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 6:40 am
by ishani modi

Hi,

I have made an app in Appery and I have to connect it to the service.
The service URL for development and production environment is different.
I want the service URL to be picked automatically as per the environment the app is running.
Let me know the way to do this?

Thanks,
Ishani


Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 9:16 am
by Maryna Brodina

Hello!

You can specify service URL in settings service and easily change it in one place (not all services settings).


Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 9:38 am
by ishani modi

Hi,
Thanks for this, I suggest that appery should provide this feature.


Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 9:50 am
by ishani modi

Hi,

If I want to add the code and file as given in the link below,where should I add this in appery ?
http://stackoverflow.com/questions/11...

Thanks,
Ishani


Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 10:17 am
by Maryna Brodina

On Source tab i iOS folder find Constants.h file, but looks like it won't be possible to implement it the way it described with the link above.
It would be much more easier to use settings service.


Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 10:25 am
by ishani modi

Hi,
Currently I am using settings service,
but every time I dont want to go and change it manually. So is there any other solution other than this ?


Change Service URL as per development and Production environment

Posted: Wed Mar 26, 2014 10:35 am
by Maryna Brodina

No, there are no other ways.


Change Service URL as per development and Production environment

Posted: Mon Sep 29, 2014 11:32 pm
by Bikram Ray

I have two uris for dev and prod. As I understand from above appery.io do not provide any support for swapping the URLs for dev to production.
If my understanding is true, is there way we can use some storage variable to hold dev and prd string which will be appended to the services url ?


Change Service URL as per development and Production environment

Posted: Tue Sep 30, 2014 3:51 am
by Yurii Orishchuk

Hi Bikram,

At first you should mark dynamic part of URL with {someParameter}
See details about it: http://devcenter.appery.io/documentat...

Then you have two ways for it:

1 You can save dynamic part of your URL in "settings service". Then use this settings for all services. And change only in this single place "settings service" when you need to change this dynamic URL part.

2 You can specify this "someParameter" in every DataSource with JS like:

pre

var someParameter = localStorage.getItem("someParameterLSV");

return someParameter;

/pre

In this time value will get dynamically from LSV.

So it's up to use what to choose.

Regards.