Summary
Create api/routes/Alumni.js with CRUD endpoints for alumni profiles. The Express server (api/server.js) is already set up to mount this router at /api.
Endpoints to implement
| Method |
Path |
Description |
GET |
/api |
List all alumni profiles |
GET |
/api/:id |
Get a single alumni profile by ID |
POST |
/api |
Create a new alumni profile |
PUT |
/api/:id |
Update an existing alumni profile |
DELETE |
/api/:id |
Delete an alumni profile |
Context
- The Alumni model is already defined in
api/models/Alumni.js
- The router should be exported as an Express Router (
module.exports = router)
server.js will import this file with require('./routes/Alumni') and mount it at /api
Running locally
docker compose -f docker-compose.dev.yml up --build
Test with:
curl http://localhost:8081/api
Summary
Create
api/routes/Alumni.jswith CRUD endpoints for alumni profiles. The Express server (api/server.js) is already set up to mount this router at/api.Endpoints to implement
GET/apiGET/api/:idPOST/apiPUT/api/:idDELETE/api/:idContext
api/models/Alumni.jsmodule.exports = router)server.jswill import this file withrequire('./routes/Alumni')and mount it at/apiRunning locally
Test with: