nba icon indicating copy to clipboard operation
nba copied to clipboard

Calling Stats endpoint

Open mathisang opened this issue 4 years ago • 2 comments

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 avatar Jun 18 '21 12:06 mathisang

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

mathisang avatar Jun 18 '21 13:06 mathisang

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

dmackerman avatar Jul 08 '23 00:07 dmackerman