Enabling CORS for endpoints to fetch money movement logs
Assuming that the game id is SrI9_M7okvCbhoM1H_fTaiWLw
, the only way to fetch a game's balance for a 3rd party app right now is to:
- call https://www.pokernow.club/games/SrI9_M7okvCbhoM1H_fTaiWLw
- call https://www.pokernow.club/socket.io/?gameID=SrI9_M7okvCbhoM1H_fTaiWLw&EIO=3&transport=polling&t=123
- repeatedly call https://www.pokernow.club/SrI9_M7okvCbhoM1H_fTaiWLw/log?after_at=&before_at=&mm=true until all logs are fetched
Unfortunately, one (or all) of the endpoints mentioned above are rate limited. A server that supports a 3rd party app that attempts to fetch logs from multiple tables to aggregate the results across multiple games won't be able to do so in a scalable way due to this limitation. The number of calls coming from this one server is each game requested by each user at any point of time.
One solution is to whitelist the rate limit for trusted third party apps.
Another solution is to allow CORS, so that the fetching can be done in the client browser. This bypasses rate limit because the requests will be coming from different IPs
And the last solution is to have one separate dedicated endpoint that serves the logs. This will be useful for everyone building apps on top of PokerNow information.