ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

Change Service URL as per development and Production environment

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Change Service URL as per development and Production environment

Hello!

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

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

Change Service URL as per development and Production environment

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

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

Change Service URL as per development and Production environment

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Change Service URL as per development and Production environment

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.

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

Change Service URL as per development and Production environment

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 ?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Change Service URL as per development and Production environment

No, there are no other ways.

Bikram Ray
Posts: 0
Joined: Wed May 22, 2013 5:52 pm

Change Service URL as per development and Production environment

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 ?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Change Service URL as per development and Production environment

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.

Return to “Issues”