janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

JavaScript file for REST URLs

It would be nice to have a "global" JavaScript file where the URLs of the rest services are defined. At the moment, in every js file are all rest URLs defined...

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

JavaScript file for REST URLs

You can use Setting service to define such things. Settings service is pretty much works like a property file:

url=http://myservice.com

Then use it in the service for URL or request parameters:

{url}

ScottIncz
Posts: 0
Joined: Sat May 26, 2012 9:03 am

JavaScript file for REST URLs

How can you make a service URL come from local storage variable?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

JavaScript file for REST URLs

In the service, define the URL to be {url}. Then, create a request parameter called 'url'.

When you do mapping for this parameter, in JavaScript run this:

localStorage.getItem('url');

Return to “Issues”