Summary
eventRoutes is registered in app.ts with the prefix /api/events. However, every route handler inside apps/backend/src/routes/event.ts also hard-codes /api/events as the path prefix. The result is that all event endpoints resolve to /api/events/api/events/..., which is unreachable by any client.
Root Cause
apps/backend/src/app.ts line 100:
await app.register(eventRoutes, { prefix: '/api/events' });
apps/backend/src/routes/event.ts lines 39, 101, 135, 175, 214:
app.post('/api/events', ...) // actual path: /api/events/api/events
app.get('/api/events/:slug', ...) // actual path: /api/events/api/events/:slug
app.post('/api/events/:slug/join', ...) // etc.
Every other route file (e.g. cards.ts, profiles.ts) correctly uses relative paths like '/' and '/:id'. Only event.ts duplicates the prefix.
Expected Behaviour
POST /api/events → create event
GET /api/events/:slug → get event
POST /api/events/:slug/join → join event
Proposed Fix
In apps/backend/src/routes/event.ts, change all absolute route paths to relative ones:
// Before
app.post('/api/events', ...)
app.get('/api/events/:slug', ...)
app.post('/api/events/:slug/join', ...)
app.delete('/api/events/:slug/leave', ...)
app.get('/api/events/:slug/attendees', ...)
// After
app.post('/', ...)
app.get('/:slug', ...)
app.post('/:slug/join', ...)
app.delete('/:slug/leave', ...)
app.get('/:slug/attendees', ...)
Acceptance Criteria
Please assign this issue to me under GSSoC
Summary
eventRoutesis registered inapp.tswith the prefix/api/events. However, every route handler insideapps/backend/src/routes/event.tsalso hard-codes/api/eventsas the path prefix. The result is that all event endpoints resolve to/api/events/api/events/..., which is unreachable by any client.Root Cause
apps/backend/src/app.tsline 100:apps/backend/src/routes/event.tslines 39, 101, 135, 175, 214:Every other route file (e.g.
cards.ts,profiles.ts) correctly uses relative paths like'/'and'/:id'. Onlyevent.tsduplicates the prefix.Expected Behaviour
POST /api/events→ create eventGET /api/events/:slug→ get eventPOST /api/events/:slug/join→ join eventProposed Fix
In
apps/backend/src/routes/event.ts, change all absolute route paths to relative ones:Acceptance Criteria
/api/eventsPlease assign this issue to me under GSSoC