diff --git a/src/pages/index.astro b/src/pages/index.astro index 05dae7b..2343a59 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -22,8 +22,14 @@ let graphProps: Awaited> = { try { driverNames = await getDriverNames(); - if (noEmptyParams && paramsNotEqual) + if (noEmptyParams && paramsNotEqual) { + const timestamp = new Date().toLocaleString('pl'); + const clientIp = + Astro.request.headers.get('X-Forwarded-For') || Astro.clientAddress; + + console.log(`[${timestamp}] ${clientIp} FROM ${source} TO ${dest}`); graphProps = await getShortestPaths(source, dest); + } } catch (error) { return Astro.redirect('/error'); }