playing-with-numbers-node
playing-with-numbers-node copied to clipboard
krishnamurthy GET endpoint does not read number from request body
trafficstars
Bug: The /krishnamurthy endpoint is defined as GET but tries to read req.body.number.
GET requests don’t have a body, so the endpoint always fails.
Steps to Reproduce:
- Run the server:
node app.js - Send GET request: http://localhost:5000/krishnamurthy?number=145
- Observe that the endpoint does not respond correctly.
Expected Behavior: The server should respond with: { "message": "The Number is a Krishnamurthy Number" }
Actual Behavior: The server cannot read the number and returns undefined or an error.