csthunes / fantasy-football-project

Project space for a web app enabling the user to play around with NFL football statistics to predict the top fantasy players of the next year.
0 stars 0 forks source link

Adapt pushPlayer function in /db-football-data/savePos.js to /controllers/player.js #10

Open csthunes opened 1 year ago

csthunes commented 1 year ago

Communication with the database should probably be limited to our controller functions (rest APIs). Since we don't know when using this function whether the player already exists, we should use POST to route it from routes/player.js. If we do not want to make this url available to communicate we can simply not route it, and leave the function in the controller for server use only.