From 7da8b3b41535b98f8630aa2d6f053a837ed0b9f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Aug 2026 11:15:53 +0000 Subject: [PATCH 1/2] Initial plan From eeca5f9a606e70608c05638d77182217703c32fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Aug 2026 11:18:28 +0000 Subject: [PATCH 2/2] Add badge API rewrite Co-authored-by: sajeetharan <4833351+sajeetharan@users.noreply.github.com> --- next.config.js | 8 ++++++++ tests/next-config.test.js | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/next-config.test.js diff --git a/next.config.js b/next.config.js index 82a16b9..6a135a9 100644 --- a/next.config.js +++ b/next.config.js @@ -25,6 +25,14 @@ const nextConfig = { }, ]; }, + async rewrites() { + return [ + { + source: '/api/badge/:login.svg', + destination: '/badge/:login.svg', + }, + ]; + }, images: { remotePatterns: [ { protocol: 'https', hostname: 'avatars.githubusercontent.com' }, diff --git a/tests/next-config.test.js b/tests/next-config.test.js new file mode 100644 index 0000000..7220201 --- /dev/null +++ b/tests/next-config.test.js @@ -0,0 +1,14 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import nextConfig from '../next.config.js'; + +test('rewrites documented badge API path to badge route', async () => { + const rewrites = await nextConfig.rewrites(); + + assert.deepEqual(rewrites, [ + { + source: '/api/badge/:login.svg', + destination: '/badge/:login.svg', + }, + ]); +});