diff --git a/pages/api/appUpdateRoute.ts b/pages/api/appUpdateRoute.ts index 3f61f38d..9c63fec2 100644 --- a/pages/api/appUpdateRoute.ts +++ b/pages/api/appUpdateRoute.ts @@ -6,6 +6,8 @@ import { NextApiRequest, NextApiResponse } from "next"; import { Octokit } from "octokit"; export default async function handler(req: NextApiRequest, res: NextApiResponse) { + console.log(`SSR - /api/appUpdateRoute`); + const octokit = new Octokit(); const response = await octokit.request("GET /repos/{owner}/{repo}/releases/latest", { owner: "cohstats", diff --git a/pages/api/getLatestPatchMapStats.ts b/pages/api/getLatestPatchMapStats.ts index 30b02994..505e959a 100644 --- a/pages/api/getLatestPatchMapStats.ts +++ b/pages/api/getLatestPatchMapStats.ts @@ -6,6 +6,8 @@ import { getStatsData } from "../../src/apis/coh3stats-api"; import { maps } from "../../src/coh3/coh3-data"; export default async function handler(req: NextApiRequest, res: NextApiResponse) { + console.log(`SSR - /api/getLatestPatchMapStats`); + try { const statsPatchSelector = config.statsPatchSelector; const fromTimeStamp = getGMTTimeStamp(new Date(statsPatchSelector[config.latestPatch].from)); diff --git a/pages/api/getNodeVersion.ts b/pages/api/getNodeVersion.ts index 6a8a45a2..f154d31e 100644 --- a/pages/api/getNodeVersion.ts +++ b/pages/api/getNodeVersion.ts @@ -16,6 +16,8 @@ const systemInfo = { }; export default async function handler(req: NextApiRequest, res: NextApiResponse) { + console.log(`SSR - /api/getNodeVersion`); + try { res.setHeader("Cache-Control", "public").status(200).json({ nodeVersion: process.version, diff --git a/pages/api/playerExport.ts b/pages/api/playerExport.ts index 755a9fdf..fc9972f7 100644 --- a/pages/api/playerExport.ts +++ b/pages/api/playerExport.ts @@ -21,6 +21,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const xff = `${req.headers["x-forwarded-for"]}`; const { profileIDs, types } = query; + logger.log(`SSR - /api/playerExport, profileIDs: ${profileIDs}, types: ${types}`); + if (!profileIDs) { return res.status(400).json({ error: "profile id param is missing" }); } diff --git a/pages/api/topLeaderboards.ts b/pages/api/topLeaderboards.ts index a9b08273..29557d67 100644 --- a/pages/api/topLeaderboards.ts +++ b/pages/api/topLeaderboards.ts @@ -7,6 +7,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) try { const query = req.query; const { race } = query; + + console.log(`SSR - /api/topLeaderboards, race: ${race}`); + const data = await getTop1v1LeaderBoards(race as raceType); res.setHeader("Cache-Control", "public, max-age=60").status(200).json(data); diff --git a/pages/desktop-app.tsx b/pages/desktop-app.tsx index 6ab4ffc9..40a3dbbe 100644 --- a/pages/desktop-app.tsx +++ b/pages/desktop-app.tsx @@ -15,6 +15,8 @@ export const getServerSideProps: GetServerSideProps = async ({ res }) => { }, }); + console.log(`SSR - /desktop-app`); + let downloadURL = "https://github.com/cohstats/coh3-stats-desktop-app/releases/latest"; // fallback in case request fails let downloadCount = 0; let version = ""; diff --git a/pages/index.tsx b/pages/index.tsx index 41088d51..6c7a3eef 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -18,6 +18,8 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) let steamNewsData: COH3SteamNewsType | null = null; let youtubeData: YouTubeVideo[] | null = null; + console.log(`SSR - /`); + try { const [ PromisedTwitchStreams, diff --git a/pages/leaderboards.tsx b/pages/leaderboards.tsx index f45fbe84..890e6015 100644 --- a/pages/leaderboards.tsx +++ b/pages/leaderboards.tsx @@ -20,6 +20,10 @@ export const getServerSideProps: GetServerSideProps = async ({ query, res }) => const sortByToFetch = sortById[sortBy as "wins" | "elo"] || 1; const regionToFetch = (region as LeaderboardRegionTypes) || null; + console.log( + `SSR - /leaderboards, race: ${raceToFetch}, type: ${typeToFetch}, platform: ${platformToFetch}, region: ${regionToFetch}`, + ); + let startNumber: number | undefined; if (start) { const number = Number(start); diff --git a/pages/news.tsx b/pages/news.tsx index 7289ceae..99ef5ca4 100644 --- a/pages/news.tsx +++ b/pages/news.tsx @@ -5,6 +5,8 @@ import SteamNewsPage from "../screens/news"; export const getServerSideProps: GetServerSideProps = async ({ res }) => { let COH3SteamNews = null; + console.log(`SSR - /news`); + try { COH3SteamNews = await getCOH3SteamNews(); diff --git a/pages/players/[...playerID].tsx b/pages/players/[...playerID].tsx index 0b82c465..23eab09b 100644 --- a/pages/players/[...playerID].tsx +++ b/pages/players/[...playerID].tsx @@ -240,6 +240,8 @@ export const getServerSideProps: GetServerSideProps = const isReplaysPage = view === "replays"; // const viewStandings = view === "standings"; + console.log(`SSR - /players/${playerID}, view: ${view}`); + let playerData = null; let playerStatsData = null; let error = null; diff --git a/pages/stats/achievements.tsx b/pages/stats/achievements.tsx index da1d64cd..6fa474f0 100644 --- a/pages/stats/achievements.tsx +++ b/pages/stats/achievements.tsx @@ -9,6 +9,8 @@ export const getServerSideProps: GetServerSideProps = }) => { const xff = `${req.headers["x-forwarded-for"]}`; + console.log(`SSR - /stats/achievements`); + let error = null; let globalAchievements = null; diff --git a/pages/stats/leaderboards.tsx b/pages/stats/leaderboards.tsx index 684747c1..60eb604a 100644 --- a/pages/stats/leaderboards.tsx +++ b/pages/stats/leaderboards.tsx @@ -63,6 +63,8 @@ export const getServerSideProps: GetServerSideProps = async ({ res }) => { let error = null; let leaderBoardStats = null; + console.log(`SSR - /stats/leaderboards`); + try { leaderBoardStats = await calculateLeaderboardStats(); diff --git a/pages/stats/players.tsx b/pages/stats/players.tsx index e03b5164..4b99dd23 100644 --- a/pages/stats/players.tsx +++ b/pages/stats/players.tsx @@ -205,6 +205,8 @@ export const getServerSideProps: GetServerSideProps = async ({ res }) => { let countries = null; let historyData = null; + console.log(`SSR - /stats/players`); + try { const docRef = doc(getFirestore(), "stats", "player-stats"); const docHistoryRef = doc(getFirestore(), "stats", "player-stats-history");