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

Calling Stats endpoint #106

Open
mathisang opened this issue Jun 18, 2021 · 2 comments
Open

Calling Stats endpoint #106

mathisang opened this issue Jun 18, 2021 · 2 comments

Comments

@mathisang
Copy link

mathisang commented Jun 18, 2021

Hi,

Actually i'm trying to fetch data players with the stats endpoints.

I'm working with React and a small Express Server to call this endpoints.
Sometimes when I call "http://localhost:1245/stats", it returns me a result, but 90% of time, it loading indefinitely...

Do you have some ideas ?

Here my route
app.get('/stats', async (req, res) => { const stats = await NBA.stats.playerSplits({ PlayerID: "2544", Season: "2019-20" }) res.json(stats); })

I'm working with a fixed ID, but then, I'm gonna call this API with a dynamic Player ID.

Thanks,

And sorry, my english sucks. ;)

@mathisang
Copy link
Author

When I fetch my local API, i got the problem.
But if I close my React server, and i'm waiting.

I can access directly to the URL of API in my browser and I can refresh, change the ID etc... And it's working

How can I fetch properly my local API ??

Thanks

@dmackerman
Copy link

That API call works fine. You aren't returning anything from your function.

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