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

feat(setlistfm-js): Add option to specify a base url #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jamsea
Copy link
Contributor

@jamsea jamsea commented Jul 28, 2019

setlist.fm is blocking API requests because of CORS https://www.setlist.fm/forum/setlistfm/setlistfm-api/api-cross-origin-request-blocked-1bd6c540

This allows you to set a different baseUrl so you can mirror their API on your server and avoid exposing your API key.

@@ -399,6 +399,11 @@ var SetlistFmApi = function(config) {
}

// Constructor Actions
self.baseUrl = defaultBaseUrl;
if (typeof config !== "undefined" && typeof config.baseUrl !== "undefined") {
self.baseUrl = config.baseUrl || defaultBaseUrl;
Copy link
Owner

@terhuerne terhuerne Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamsea Please don't assign "defaultBaseUrl" as a fallback for this check, because this is not necessary. You already assign "defaultBaseUrl" in line 402 to "self.baseUrl" and the check in line 403 for "config.baseUrl to be defined.

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

Successfully merging this pull request may close these issues.

2 participants