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
Bug: The
/leap_yearPOST endpoint crashes when sending a valid year in JSON.Steps to Reproduce:
node app.js{
"number": 2024
}
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