Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a 'baseURL' option #95

Open
NickPadilla opened this issue Feb 11, 2014 · 1 comment
Open

Provide a 'baseURL' option #95

NickPadilla opened this issue Feb 11, 2014 · 1 comment

Comments

@NickPadilla
Copy link

When using 'crossDomain' functionality we have to put the full URL, from my understanding, in each of the 'request.define'. This makes it difficult to test and switch environments. I would be helpful to be able to define a baseURL in a global fashion, then in the defines we can just provide the path for the given resource.

@dcneiner
Copy link
Contributor

If every request you are defining uses the same base URL, you could do this:

amplify.subscribe( "request.ajax.preprocess", function( defnSettings, settings, ajaxSettings ) {
    ajaxSettings.url = "http://baseurl.com/" + ajaxSettings.url;
});

If only some function that way, you could add some tests for the existing URL before modifying it.

Its not as efficient as setting it ahead of time, but it would provide the flexibility you want. I'll leave this feature request open in the mean time to see if it is something we could add to the amplify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants