Summary
In apps/backend/src/routes/public.ts, three routes are accidentally defined twice. The first registration uses a config: { rateLimit: {...} } object but contains no handler body — instead, the actual handler is a second app.get(...) call nested inside the first one. Fastify registers the outer call as a route with no handler and ignores the inner call. In practice this means the intended business logic never executes.
Root Cause
apps/backend/src/routes/public.ts:
// Outer call — registered as a route, no handler body
app.get('/:username', {
config: { rateLimit: { max: 100, timeWindow: '1 minute' } }
}, async (request, reply) => {
// ← JSDoc comment, then...
app.get('/:username', async (request, reply) => { // ← inner duplicate
// actual logic lives here
});
});
The same pattern occurs for /:username/card/:cardId (lines 221 and 234).
Expected Behaviour
Rate limiting config and handler body should be in one app.get() call per route.
Proposed Fix
Merge each pair into a single registration:
app.get('/:username', {
config: { rateLimit: { max: 100, timeWindow: '1 minute' } },
}, async (request: FastifyRequest<{ Params: { username: string } }>, reply: FastifyReply) => {
// actual handler logic here
});
Apply the same merge to /:username/card/:cardId.
Acceptance Criteria
Please assign this issue to me under GSSoC
Summary
In
apps/backend/src/routes/public.ts, three routes are accidentally defined twice. The first registration uses aconfig: { rateLimit: {...} }object but contains no handler body — instead, the actual handler is a secondapp.get(...)call nested inside the first one. Fastify registers the outer call as a route with no handler and ignores the inner call. In practice this means the intended business logic never executes.Root Cause
apps/backend/src/routes/public.ts:The same pattern occurs for
/:username/card/:cardId(lines 221 and 234).Expected Behaviour
Rate limiting config and handler body should be in one
app.get()call per route.Proposed Fix
Merge each pair into a single registration:
Apply the same merge to
/:username/card/:cardId.Acceptance Criteria
GET /api/u/:usernamereturns correct profile dataGET /api/u/:username/card/:cardIdreturns correct card dataPlease assign this issue to me under GSSoC