bttmly / nba

Node.js client for nba.com API endpoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling Stats endpoint

mathisang opened this issue · 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. ;)

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

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