From d152b2c4c1de980ec37eb13b6d30266c7a98c5d9 Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Thu, 16 Oct 2025 09:49:17 +0200 Subject: [PATCH] remove trailing slashes from URLs in frontend code --- frontend/frontend/src/components/Card/Card.js | 2 +- frontend/frontend/src/pages/Demo/Demo.js | 8 ++++---- frontend/frontend/src/pages/Home/stages/Display.js | 2 +- frontend/frontend/src/pages/Home/stages/SelectCard.js | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/frontend/src/components/Card/Card.js b/frontend/frontend/src/components/Card/Card.js index 31838bcb..ab6507f8 100644 --- a/frontend/frontend/src/components/Card/Card.js +++ b/frontend/frontend/src/components/Card/Card.js @@ -6,7 +6,7 @@ import { classnames } from '../../utils'; import { HOST } from '../../constants'; export const Image = ({ imageSrc, compact, extraClasses = '' }) => { - const fullImageSrc = `https://${HOST}/api/${imageSrc}&client=wizard`; + const fullImageSrc = `https://${HOST}/api${imageSrc}&client=wizard`; return (
diff --git a/frontend/frontend/src/pages/Demo/Demo.js b/frontend/frontend/src/pages/Demo/Demo.js index 3dfd1391..573a33db 100644 --- a/frontend/frontend/src/pages/Demo/Demo.js +++ b/frontend/frontend/src/pages/Demo/Demo.js @@ -27,13 +27,13 @@ const DemoScreen = () => { const firstCardUrl = selectedUserName.length > 0 - ? `https://${HOST}/api/?username=${selectedUserName}&client=demo` - : `https://${HOST}/api/?username=anuraghazra&client=demo`; + ? `https://${HOST}/api?username=${selectedUserName}&client=demo` + : `https://${HOST}/api?username=anuraghazra&client=demo`; const secondCardUrl = selectedUserName.length > 0 - ? `https://${HOST}/api/top-langs/?username=${selectedUserName}&client=demo` - : `https://${HOST}/api/top-langs/?username=anuraghazra&client=demo`; + ? `https://${HOST}/api/top-langs?username=${selectedUserName}&client=demo` + : `https://${HOST}/api/top-langs?username=anuraghazra&client=demo`; return (
diff --git a/frontend/frontend/src/pages/Home/stages/Display.js b/frontend/frontend/src/pages/Home/stages/Display.js index 4f60d8e7..e472e3d3 100644 --- a/frontend/frontend/src/pages/Home/stages/Display.js +++ b/frontend/frontend/src/pages/Home/stages/Display.js @@ -29,7 +29,7 @@ const DisplayStage = ({ userId, themeSuffix }) => { const copyUrl = () => { navigator.clipboard.writeText( - `https://${HOST}/api/${themeSuffix}&username=${userId}`, + `https://${HOST}/api${themeSuffix}&username=${userId}`, ); toast.info('Copied to Clipboard!', { position: 'bottom-right', diff --git a/frontend/frontend/src/pages/Home/stages/SelectCard.js b/frontend/frontend/src/pages/Home/stages/SelectCard.js index da487913..89002063 100644 --- a/frontend/frontend/src/pages/Home/stages/SelectCard.js +++ b/frontend/frontend/src/pages/Home/stages/SelectCard.js @@ -20,27 +20,27 @@ const SelectCardStage = ({ selectedCard, setSelectedCard, setImageSrc }) => { { title: 'Top Languages Card', description: 'your most frequently used languages', - imageSrc: `top-langs/?&username=${userId}&langs_count=4`, + imageSrc: `/top-langs?&username=${userId}&langs_count=4`, cardType: 'top-langs', }, { title: 'GitHub Extra Pins', description: 'pin more than 6 repositories in your profile using a GitHub profile readme', - imageSrc: 'pin/?repo=anuraghazra/github-readme-stats', + imageSrc: '/pin?repo=anuraghazra/github-readme-stats', cardType: 'pin', }, { title: 'GitHub Gist Pins', description: 'pin gists in your GitHub profile using a GitHub profile readme', - imageSrc: 'gist/?id=bbfce31e0217a3689c8d961a356cb10d', + imageSrc: '/gist?id=bbfce31e0217a3689c8d961a356cb10d', cardType: 'gist', }, { title: 'WakaTime Stats Card', description: 'your coding activity from WakaTime', - imageSrc: 'wakatime/?username=ffflabs&langs_count=6&card_width=450', + imageSrc: '/wakatime?username=ffflabs&langs_count=6&card_width=450', cardType: 'wakatime', }, ].map((card, index) => (