ColCross / bgg-sdk

Node SDK for querying the Board Game Geek (BGG) XML2 API
https://colcross.github.io/bgg-sdk/
MIT License
5 stars 1 forks source link

Making the BGG Endpoint Configurable via an Environment Variable to Facilitate Testing #2

Open augustovanderley opened 3 weeks ago

augustovanderley commented 3 weeks ago

Hi,

I'm trying to use the library in my React application. I managed to use the search function successfully. However, I'm encountering CORS issues with the collection function.

For local development and ease of deployment, it would be helpful if I could define the BGG endpoint through an environment variable, allowing me to set it to localhost for testing purposes. This way, I can use a proxy server in Vite without needing to create a backend proxy.

https://github.com/ColCross/bgg-sdk/blob/bcdfe662b49ea06d1f87d012ad14f12375255383/src/lib/axios.ts#L5C1-L7C4

If you wish, I can create a pull request for this.

ColCross commented 2 weeks ago

Hello! Apologies I didn’t see this before now. Feel free to open a PR, or I will look into this shortly