This is a simple Express.js backend server for a doctor's assignment, demonstrating basic CRUD operations on user kidney data.
- GET /: Retrieve the number of kidneys, healthy kidneys, and unhealthy kidneys for the first user.
- POST /: Add a new kidney to the first user (specify
isHealthyin the request body). - PUT /: Mark all kidneys of the first user as healthy.
- DELETE /: Remove all unhealthy kidneys from the first user.
- Make sure you have Node.js installed.
- Run
npm installto install dependencies.
Run node index.js to start the server on port 3000.
Use tools like Postman or curl to test the endpoints. The server expects JSON data for POST requests.
Example POST request:
POST http://localhost:3000/
Content-Type: application/json
{
"isHealthy": true
}