Skip to content

Fix API Endpoint Mismatches Between Frontend and BackendΒ #291

@ElioNeto

Description

@ElioNeto

Fix API Endpoint Mismatches

The Angular frontend was built against an older or different API contract. Several endpoints called by the frontend do not match what the backend actually exposes.

Mismatches to Fix

πŸ”΄ Critical β€” Frontend calls that fail

Frontend Call What It Does Backend Reality Fix
POST /keys with body {key, value} Insert/update Backend has PUT /keys/{key} with body {value} Fix frontend: change to PUT /keys/{key} or fix backend: register POST /keys handler
GET /keys/search?q=&prefix= Search keys No such endpoint Fix backend: register GET /keys/search or fix frontend: use GET /keys?prefix=
POST /keys/batch Batch insert No such endpoint Fix backend: register batch endpoint
GET /scan Scan all keys No such REST endpoint Fix backend: register GET /scan or use GraphQL

🟑 Medium β€” Endpoints that partially work

Frontend Call Backend Reality Fix
GET /stats/all Backend has GET /stats Align frontend to use /stats
GET /health Backend has /health/liveness, /health/readiness, /health/startup Align frontend to use correct health endpoints

Missing Backend Endpoints (Frontend expects them)

The following pages are fully built in the frontend but have NO backend routes:

Frontend Page Endpoints Needed Status
Features (/features) GET /features, POST /features/{name} Backend src/features/ exists but has no API handlers
Admin Tokens (/admin) GET /admin/tokens, POST /admin/tokens, DELETE /admin/tokens/{id} TokenManager exists but no REST routes

Files to Modify

Frontend:

  • frontend/src/app/services/apex-store.service.ts β€” Update endpoint URLs

Backend:

  • src/api/mod.rs β€” Register new endpoints
  • src/api/admin/mod.rs β€” Token CRUD routes
  • src/features/mod.rs β€” Feature flag API handlers (or new src/api/features.rs)

Acceptance Criteria

  • Frontend Dashboard PUT/GET operations work end-to-end
  • Frontend Key Explorer search works end-to-end
  • Frontend Key Explorer batch insert works
  • Frontend Features page loads and toggles flags
  • Frontend Admin tokens page creates, lists, and revokes tokens
  • No 404/405 errors in browser DevTools network tab
  • All existing frontend tests pass

Parent Epic

#290

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions