Skip to content

Commit

Permalink
Added log to api requests on backend
Browse files Browse the repository at this point in the history
  • Loading branch information
thieleju committed Jun 21, 2023
1 parent 910f15f commit 663e81e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/routes/wld_chess_com.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ router.post("/", async (req, res) => {
`https://api.chess.com/pub/player/${username}/games/${year}/${month}`,
{
headers: {
"User-Agent": `wld.node5.de (username: ${user_agent_username}; contact:${user_agent_email})`,
"User-Agent": `wld.node5.de (username: ${user_agent_username}; contact: ${user_agent_email})`,
},
}
);

// log api request and user agent
console.log(
`GET https://api.chess.com/pub/player/${username}/games/${year}/${month} (username: ${user_agent_username}; contact: ${user_agent_email})`
);

// filter games depending on date and mode
const games = response.data.games.filter((game) => {
// filter game mode and time interval
Expand Down

0 comments on commit 663e81e

Please sign in to comment.