playing-with-numbers-node
playing-with-numbers-node copied to clipboard
Leap Year endpoint crashes on valid input
trafficstars
Bug: The /leap_year POST endpoint crashes when sending a valid year in JSON.
Steps to Reproduce:
- Run the server:
node app.js - Send POST request: { "number": 2024 }
- Observe server crash
Expected Behavior: The server should respond with: { "message": "The given year is a leap year" }
Actual Behavior: The server throws an error: TypeError: res.status is not a function