bttmly / nba

Node.js client for nba.com API endpoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

michaelwmason opened this issue · comments

How is this supposed to be used? If it is an npm package that would lead me to believe I could use it with my Angular application. What is its intended use if it can't be used in the browser? Could I deploy this on a server and use it as middleware for the endpoints?

This is meant to be used on the server with Node.js. You can also use it to scrape data from NBA and populate a database. For what it's worth, what prevents browser use is the browser security model (CORS specifically).

There is a very simple, minimal implementation of using this package to proxy requests from the browser to the NBA's API: https://github.com/bttmly/nba/blob/master/scripts/proxy.js